[comp.unix.internals] How do I ...

rbj@uunet.UU.NET (Root Boy Jim) (03/07/91)

>How do I get the current time into my command line prompt?

If you use tcsh, "%t" expands to the current time. My prompt is
"%t %d %S[rbj@%m %h]%s ", which expands to "3:03pm /home/rbj [rbj@uunet 2] "
withe the stuff in brackets in reverse video.

>The answer is: it depends.  Some shells allow for the execution of embedded
>commands in a prompt; the Big Three (sh, csh, ksh) do not.

Tsk Tsk. Page 79 of the KornShell book tells how to do this.
I just typed it in and it works.
-- 
		[rbj@uunet 1] stty sane
		unknown mode: sane