Time stamp history list in bash

Time stamp history list in bash

Post by Zygmunt M. Zarzeck » Sun, 25 May 2003 04:40:38



HI

How to time stamp history list in bash?

Regards

zyga

 
 
 

Time stamp history list in bash

Post by R. Bernste » Mon, 26 May 2003 05:24:33


"Zygmunt M. Zarzecki" asks:

Quote:> How to time stamp history list in bash?

This was something on my to-do list for a while. Well, I've just done
it in the experimental bash de* project (http://www.veryComputer.com/).

I haven't made a release for this yet as this is all a bit
new. However you can compile this from CVS sources:



The format of the timestamp shown in a command history is controlled
by the $HISTTIMEFORMAT environment variable via strftime; the default
value is '%a %T ' (abbreviated weekday name and 24-hour time with
seconds). Note the trailing blank. See strftime(3) for a list of time
conversion specifiers.

Also note that if you run the regression tests as I generally do,
depending on when you run this, some tests involving history checking
may fail. At present I haven't updated the tests to reflect the fact
that the time is by default printed in the history list.