Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Section - 1.400: How do I make an informative prompt in the shell?

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Restaurant inspections ]


Top Document: comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Previous Document: 1.306: Why do PIDs run non-sequentially?
Next Document: 1.401: How do I set up ksh for emacs mode command line editing?
See reader questions & answers on this topic! - Help others by sharing your knowledge
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.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Previous Document: 1.306: Why do PIDs run non-sequentially?
Next Document: 1.401: How do I set up ksh for emacs mode command line editing?

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
bofh@mail.teleweb.pt (Jose Pina Coelho)





Last Update March 27 2014 @ 02:11 PM