3 ms·
I set PROMPT_CMD to the following function: function log_history { echo "`date '+%Y-%m-%d %H:%M:%S'` $HOSTNAME:$$ $PWD ($?) `history 1`" >> $MYHIST
by euske 7y ago
I set PROMPT_CMD to the following function:
function log_history {
echo "`date '+%Y-%m-%d %H:%M:%S'` $HOSTNAME:$$ $PWD ($?) `history 1`" >> $MYHISTFILE
}
which records a timestamp, host name, shell pid, working directory and exit status for each command.