Bash logging: two questions

jimbob palmer jimbobpalmer at
Wed Jul 21 15:07:04 UTC 2010


I would like to run a bash script but to log output and exit codes.
Essentially I would like to run the script with bash -x, but for that
output to the log to go to a file, and the normal output as from
running a normal script to go to the terminal.

That's my first question :)

My second question is about history. Bash has a -h option to remember
the location of commands as they are looked up. Is it possible for
this to be recorded in the history? e.g. if I run ls, it would record
/bin/ls to the bash history file.

Many thanks.


More information about the freebsd-questions mailing list