Supplementary Command History Logging in Bash: Tracking Working Directory, Date/Times, etc.

Comments

3 comments posted
minor modification required

#need to allow spaces before the nubmers in bash history

histleader=`expr "$histentry" : ' *\([0-9]* \[[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*\]\)'`

histentrycmd=${histentry# *[0-9]* \[[0-9\-\: ]*\] }

Posted by erik aronesty (not verified) on Fri, 06/10/2011 - 12:03
I tried added what you

I tried added what you suggested above and it does not seem to log to the default log file. Doesn't seem like anything is even logging. Even tried adding the location of the logfile and still nothing.

export PROMPT_COMMAND='_loghistory -e -h -y -t'

Posted by Anonymous (not verified) on Mon, 03/21/2011 - 09:55
It's What I Have On Mine

And it works for me. Have you tried just:

export PROMPT_COMMAND=_loghistory

And are you sure that the above command is being sourced into your current shell AND you have your history activated?

Posted by Jeet Sukumaran on Tue, 03/22/2011 - 11:35

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a biological visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.