Redirect stderr to stdout
* * * * ½ 2 votos
October 1st, 2006 toydi
Very simple, just remember:
1 = stdout
2 = stderr
In python, its
unittest
module loves to dump test results to stderr (rather than stdout). In order to pipe the results to
less
, you may need to redirect stderr to stdout:
python eggtest.py 2>&1 | less
To redirect stderr into a file:
python eggtest.py 2> result.txt
To redirect both stdout and stderr into a [...]
Posted in pipeline, stderr, stdout | Hits: 17047 | 1 Comment »
Live Chat!








