| CPUG | |
| The Check Point User Group | |
| A Resource For The Check Point Community. Fast. Useful. Independent. | |
|
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| I was looking to see if it was possible to have the command prompt actually show date time and current working directory as well as user. I have gotten it to show these values but it is not dynamic. hence if I change directory it doesn't change it in the prompt. Same with the time/date. time does not dynamically change err.. show current time for every command line. Currently I have this: set prompt="`hostname -s`-`date`[$USER]$cwd #" I am looking to do this for tracking and auditing purposes. Any help would be greatly appreciated. |
| |||
| My personal favorite. It shows dynamic time, user, hostname, path. The new line is personal taste for long commands. export PS1="[\A \u@\h:\w]\n\\$" In expert mode it will show always root as user until you modify /etc/bashrc more options: Code: \d the date in "Weekday Month Date" format (e.g., "Tue May 26")
\e an ASCII escape character (033)
\h the hostname up to the first `.'
\H the hostname
\j the number of jobs currently managed by the shell
\l the basename of the shell's terminal device name
\n newline
\r carriage return
\s the name of the shell, the basename of $0 (the portion following the final slash)
\t the current time in 24-hour HH:MM:SS format
\T the current time in 12-hour HH:MM:SS format
\@ the current time in 12-hour am/pm format
\A the current time in 24-hour HH:MM format
\u the username of the current user
\v the version of bash (e.g., 2.00)
\V the release of bash, version + patch level (e.g., 2.00.0)
\w the current working directory, with $HOME abbreviated with a tilde
\W the basename of the current working directory, with $HOME abbreviated with a tilde
\! the history number of this command
\# the command number of this command
\$ if the effective UID is 0, a #, otherwise a $
\nnn the character corresponding to the octal number nnn
\\ a backslash
\[ begin a sequence of non-printing characters, which could
be used to embed a terminal control sequence into the prompt
\] end a sequence of non-printing characters |
| |||
| ok, it is nearly the same: set prompt = "[%P `whoami`@%m:%/ ]\n# " If you need more options try this man page http://www.freebsd.org/cgi/man.cgi?q...SE&format=html |
| |||
| I tried this but it did not work. I beleive that the version of csh on NOKIA is a bit different (stripped) I am still checking CHECKPOINT and NOKIA websites. fwname[admin]# fwname[admin]# set prompt = "[%P `whoami`@%m:%/ ]\n# " whoami: Command not found. [%P @%m:%/ ]\n# csh fwname[admin]# |
![]() |
| Thread Tools | |
| Display Modes | |
| |