Date stamping commands in the shell command history file

Date stamping commands in the shell command history file

Post by Craig Irvin » Thu, 20 Nov 1997 04:00:00



Hi All,

I need to date stamp commands in the history file as the subject says.

I am using the Korn shell with the default history file (.sh_history and
size of 128.

I have tried things like PS1='$(date>>$HOME/.sh_history)\$' in the
profile.  This works when you log in but doesn't work after that.

How can I get it to work every time the prompt is displayed??

I presume that I'm on the right track trying to modify the primary prompt.
I know that I could do an alias for each command and script for the 30 - 40
that we commonly use but that wouldn't cover all commands.

Any help is much appreciated.

TIA
Craig

 
 
 

1. Date stamping commands in the history file in ksh

Hi All,

I need to date stamp commands in the history file as the subject says.

I am using the Korn shell with the default history file (.sh_history and
size of 128 running on under MAX/OS by Concurrent.

I have tried things like PS1='$(date>>$HOME/.sh_history)\$' in the
profile.? This works when you log in but doesn't work after that.

How can I get it to work every time the prompt is displayed??

I presume that I'm on the right track trying to modify the primary prompt (PS1).
I know that I could do an alias for each command and script for the 30 - 40
that we commonly use but that wouldn't cover all commands.

Any help is much appreciated.

TIA
Craig


2. .rm (real audio) convertor to .au format wanted

3. C shell command to use 'file' command to automatically scale a file

4. can I use perl to write a Postscript file and send it to the printer?

5. Does DIFF command check date/time stamp ?

6. Help:Apache 1.3.12 - httpd child keep increasing

7. Date or Time Stamp Command Help

8. zsh error - mismatched "

9. Adding date/time information to unix command history

10. ksh: 2 Q's, command completion & command history?

11. rememeber history of tcshell command line commands after reboot

12. History command with the date

13. source code for the history mechanism that is provided by the csh command shell