Results 1 to 4 of 4
Hello all,
I am again struggling to make a script work, but hey, it is fun, I am learning new things.
I discovered the set -x option which was, for ...
- 08-06-2010 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 6
How to redirect ALL output to a (log) file
Hello all,
I am again struggling to make a script work, but hey, it is fun, I am learning new things.
I discovered the set -x option which was, for me, like the second coming.
Still, what I am not able to do is redirect ALL output to a (log) file, including what is produced by the -x setting.
Let's assume a very simple script:
and I am running it as . test.sh >> /var/log/test.rmcb.logCode:#!/bin/bash set -x source="/home/atelier/Bureau/" ls -la $source
The result of ls goes inded into the log file, but the rest still shows on the console where I am running the script:
Is there a way to redirect EVERYTHING to the log file ?Code:++ source=/home/atelier/Bureau/ ++ ls --color=auto -la /home/atelier/Bureau/
Any ideas ?
Thanks in advance,
rmcb
- 08-06-2010 #2
- 08-06-2010 #3Just Joined!
- Join Date
- Jan 2009
- Posts
- 6
Thx.
Solved. I didn't know that the + output was STDERR
- 08-06-2010 #4
You are welcome!


Reply With Quote