Page 1 of 1

Bash variable not working

Posted: Mon Jan 23, 2012 8:33 pm
by grash54
First, sorry if this isn 't the right place to post this.

OK, what I thought was pretty simple doesn't work and is driving me nuts...

Added to /etc/bash.bashrc
export HISTTIMEFORMAT="%h %d %H:%M:%S "
export HISTSIZE=10000

Typing env shows both variables, however using up arrow up arrow for history the HISTTIMEFORMAT isn't working.
This is after logging out and back in, rebooting etc. I'm using Mint 12.
If anyone can help me with this it would be greatly apprecated as Ive been searching and working on it for 3 days now.
Thanks in advance for any help!

Re: Bash variable not working

Posted: Mon Jan 23, 2012 8:56 pm
by doktornotor
If this variable is set, time stamps are written to the history file so they may be preserved across shell sessions.
This will NOT add the (proper) timestamps retroactively to your history by some miracle. Also, this will NOT have any effect when navigating the history via keyboard (would make the history totally unusable for recycling commands). You can see the timestamps when you type the

Code: Select all

history
built-in command.

Re: Bash variable not working

Posted: Thu Jan 26, 2012 4:35 am
by grash54
Yep, you're right and boy do I feel stupid. Many thanks for your reply!