Results 1 to 3 of 3
Hello everyone,
I have a script that generates a bunch of output, including the expansions details provided by: set -v -x
I am trying to pipe everything that is displayed ...
- 06-10-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 6
[SOLVED] bash: capture all output to a log
Hello everyone,
I have a script that generates a bunch of output, including the expansions details provided by: set -v -x
I am trying to pipe everything that is displayed to a file, in addition to displaying it on the screen. I've managed to get stderr and stdout into the file, but the expansions are only printed to the screen. Here is what I have so far:
sudo -u <user> source my_job.sh |tee my_log.txt 2>&1
Can anyone help? Is there another stream I am missing? Thanks in advance!
- 06-10-2010 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
Try this:
sudo -u <user> source my_job.sh 2>&1 | tee my_log.txt
- 06-10-2010 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 6
It worked! Thanks so much!


