Since I use Tcsh and already have a reasonably useful prompt, I wanted to add a time stamp to it.
Previously looking like this:
isaac@aisap1-1:/export/home/isaac>
...and being defined as:
set prompt="`whoami`@`hostname`:`pwd`> ".. I really did want a time stamp in there...somewhere.
Giving a few whirls with the /bin/date command made me realize that there must be a better way.
And as it turns out there is and its only 2 bytes long: %t
What I really wanted was something that looks like this:
isaac@unixman:/export/home/isaac: 12:20pm
So, I've added %B and %b around %t, and now my prompt in my .cshrc file is defined as:
set prompt="`/usr/ucb/whoami`@`hostname`:`pwd`:%B %t %b> "
You can also use %T, instead of %t, to change time format of the time printed.
Cool, huh ?
set prompt = "%n@%m:%/:%B %t %b> "
?
Posted by Peter Tribble on February 14, 2005 at 06:18 PM EST #
Posted by isaac on February 14, 2005 at 07:57 PM EST #
The %n, %m and %/ stuff is a lot better than backquoted commands IMHO. A lot of unnecessary process forking is saved when they are used :-)
My own tcsh prompt stuff is:
Posted by Giorgos Keramidas on February 15, 2005 at 05:24 AM EST #
Posted by fdasfdsa on October 12, 2006 at 09:18 AM EDT #