I set the
HISTTIMEFORMAT variable to store the timestamp info
.bash_history file. I am able to display the history properly if I use interactive shell.
But, when I run history command to display history, the time stamp info of
.bash_history file is is displayed as command and time stamp info of all the commands are set to current time.
Example file contents:
#45556656 pwd #45677756 ls #45665765 who
$ ssh Host 'HISTFILE=~/bash_history;HISTTIMEFORMAT=" %F %T ";set -o history; history'
235 2015-08-24 13:12 #45556656 236 2015-08-24 13:12 pwd 237 2015-08-24 13:12 #45677756 238 2015-08-24 13:12 ls
Issues: 1. Time stamp is same for all commands. It sets to the current timestamp.
Time info from history file is read as command. So lost the actual time stamp info of commands.
How to get the correct info when I try to get the info through
Note: I have seen similar questions but none has given solution to my problem and none, who asked the question, elaborated the scenario.