Time in prompt?

The Rastafari Yakker yakker at bartok.ucr.edu
Wed Jun 14 06:16:54 AEST 1989


There are a number of ways to put the time into the prompt, but it
may not be the best thing to do.  Here's a little command I tried
and got to work, but there's a problem with it:

          set prompt = "(`date '+%H:%M:%S'`):  "

This works, but the time isn't updated.  The C shell has to be reset
in order to update the time.  If you wanted to constantly update the
time, you would have to run a constant (C) shell in the background that
runs a command and then updates the prompt time.

 
      set prompt = "(`date '+%H:%M:%S'`):  "
      alias cd 'chdir \!*; set prompt = "(`date '+%H:%M:%S'`):  "'

Other than this, I don't know of another way to correctly change the
time without creating another shell in the background and making it 
more of a bother than checking your watch.

---------------------------------------*--------------------------------------
"Behold, God, is my salvation, I       |   Internet:    yakker at ucrmath.ucr.edu
will trust, and not be afraid.."      |+|      UUCP:    ...ucsd!ucrmath!yakker
                                     |+|+|          
"What lies behind you and what lies  |+|+|        The University of California
before you pales insignificant when   |+|                         at Riverside
compared to what lies within you.."    |        Department of Computer Science
---------------------------------------*--------------------------------------



More information about the Comp.unix.questions mailing list