[olug] What's the value of your $PS1 variable?

Will Langford unfies at gmail.com
Wed Jan 28 02:34:00 UTC 2009


No colors here, but:
PS1='\[\033]0;\u@\h:\w\007\]\n>>>
[${SYSHOST}]-[${PROMPT_DATE}]-[${LOAD}]-${fill}-[${newPWD}] <<<\n[\u@\h
\W]\$ '

where we've got PROMPT_COMMAND set to a bash function that dynamically fills
in values etc etc etc.

This gives you standard prompt, arbitrary host name (setup by us in
/etc/profile), the current date and time, 3 figure load avg, full current
working directory... all filled to the width of the current terminal with
the full CWD being front-truncated to fit if there's not enough space:

>>> [WEBROOT-TEST]-[01/27 20:33:30]-[0.07 0.03 0.00]------------[/usr/local]
<<<
[root at fu1 local]#

-Will



More information about the OLUG mailing list