Bash variable not working

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
grash54

Bash variable not working

Post 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!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
doktornotor
Level 4
Level 4
Posts: 203
Joined: Mon Jan 23, 2012 6:28 pm

Re: Bash variable not working

Post 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.
grash54

Re: Bash variable not working

Post by grash54 »

Yep, you're right and boy do I feel stupid. Many thanks for your reply!
Locked

Return to “Scripts & Bash”