bash-preexec
bash-preexec copied to clipboard
detailed bash log with preexec and precmd
Hi, as I mentioned in previous issue #147 I'm recording bash history in a custom way. As of now, I'm trying to save the command (and current directory) to a file using preexec
. Can I use precmd
to keep duration and exit code of the command and then also save them?
Actually, is it possible for preexec()
to keep the command as variable and then pass it to precmd
as input? In that case precmd()
has everything (i.e. command, folder, duration, exit code) to save to a log file.