[PLUG] Putting Date/Time in ksh prompt

Steve Bonds 1s7k8uhcd001 at sneakemail.com
Thu Sep 26 22:47:05 UTC 2002


On Thu, 26 Sep 2002, Shannon C. Dealy dealy at deatech.com wrote:

> On Thu, 26 Sep 2002, Steve Bonds wrote:
> 
> > It looks like this bit of shell hackery will not extend itself to dates,
> > since dates can't be done just by dividing the number of seconds since
> > start.  :-(
> 
> I haven't been following this thread, but you can get any kind of a date
> prompt you want in ksh by setting your prompt to the date command with
> appropriate options, this:
> 
>   PS1='`date +%D\ %k:%M\>`'
> 
> Gives a prompt like this:
> 
>    09/26/02 13:30>

Alas, this does not work in ksh, the shell I'm currently stuck with on the
servers I'm working on.

I already included a brief "wish I were using bash" rant.  ;-)

  -- Steve






More information about the PLUG mailing list