How do I ... (NOT a FAQ)

Root Boy Jim rbj at uunet.UU.NET
Thu Mar 7 06:28:10 AEST 1991


>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 at 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 at uunet 1] stty sane
		unknown mode: sane



More information about the Comp.unix.internals mailing list