shell history - date + time ? - Unix

This is a discussion on shell history - date + time ? - Unix ; Anyone got a setting or script that would dated/time the commands in ksh/bash history ? This isn't for security purpose so I am not looking for audit style logging... TIA....

+ Reply to Thread
Results 1 to 3 of 3

Thread: shell history - date + time ?

  1. shell history - date + time ?

    Anyone got a setting or script that would dated/time the commands in ksh/bash history ?
    This isn't for security purpose so I am not looking for audit style logging...
    TIA.

  2. Re: shell history - date + time ?

    On 2006-10-03, wrote:
    > Anyone got a setting or script that would dated/time the commands in ksh/bash history ?
    > This isn't for security purpose so I am not looking for audit style logging...


    man bash:

    HISTTIMEFORMAT
    If this variable is set and not null, its value is used as a
    format string for strftime(3) to print the time stamp associated
    with each history entry displayed by the history builtin. If
    this variable is set, time stamps are written to the history
    file so they may be preserved across shell sessions.

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  3. Re: shell history - date + time ?

    Chris F.A. Johnson wrote:
    > On 2006-10-03, wrote:
    >> Anyone got a setting or script that would dated/time the commands in ksh/bash history ?
    >> This isn't for security purpose so I am not looking for audit style logging...


    > man bash:


    > HISTTIMEFORMAT
    > If this variable is set and not null, its value is used as a
    > format string for strftime(3) to print the time stamp associated
    > with each history entry displayed by the history builtin. If
    > this variable is set, time stamps are written to the history
    > file so they may be preserved across shell sessions.


    This seem to be effective only for bash version 3.x ...
    However, using it to search showed something related with PROMPT_COMMAND which might work.
    Thanks.


    > --
    > Chris F.A. Johnson, author |
    > Shell Scripting Recipes: | My code in this post, if any,
    > A Problem-Solution Approach | is released under the
    > 2005, Apress | GNU General Public Licence


+ Reply to Thread