[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
In the Korn Shell (ksh), the PS1 variable is expanded each time it is printed, so you can use: $ export myhost=`hostname` $ PS1='$LOGNAME@$myhost $PWD \$ ' to get, e.g. bengsig@ieibm1 /u/bengsig $ In the C-shell, use: % set myhost=`hostname` % alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "' % cd to get, e.g. bengsig@dkunix9 /u/bengsig/aixfaq % There is no easy solution in the Bourne Shell. Use the Korn Shell instead.
Send corrections/additions to the FAQ Maintainer:
Last Update May 13 2007 @ 00:21 AM