bash redirection question

Kenny Donahue kennyd at mc.com
Fri Nov 7 15:40:44 EST 2003


Here is a simple question (I hope) for all you bash experts.

I have a c program that gathers a bunch of information then writes
this information to a file.  The c program then calls a bash script with
the file that was created as an argument.  The bash script sources the
file and does things according to what was set in the file.

Now the problem. I'd like to use the same log file for the c program
and the shell script. Since I'm making calls in the script such as insmod,
rm, lsmod, rmod. etc... I'd like to redirect the output from
1. My echos
2. stdio from all system calls
3. stderr from all system calls
But still have everything displayed on the screen

I'd like to do this without appending " | tee -a $log_file"
to everything.
Any ideas?

Thanks in advance,
Kenny




More information about the gnhlug-discuss mailing list