Bash variable not working

Forum rules
Before you post please read how to get help

Bash variable not working

Postby grash54 on Mon Jan 23, 2012 8:33 pm

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!
grash54
Level 1
Level 1
 
Posts: 3
Joined: Fri Dec 09, 2011 5:27 pm

Linux Mint is funded by ads and donations.
 

Re: Bash variable not working

Postby doktornotor on Mon Jan 23, 2012 8:56 pm

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.
doktornotor
Level 4
Level 4
 
Posts: 212
Joined: Mon Jan 23, 2012 6:28 pm

Re: Bash variable not working

Postby grash54 on Thu Jan 26, 2012 4:35 am

Yep, you're right and boy do I feel stupid. Many thanks for your reply!
grash54
Level 1
Level 1
 
Posts: 3
Joined: Fri Dec 09, 2011 5:27 pm


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 3 guests