Example that runs myscript.sh
, and redirects all STDERR
to STDOUT
so you can use a
pager.
$ ./myscript.sh 2>&1 | less
The important part is 2>&1
, which says STDERR
, which is 2, should be redirected to
STDOUT
, which is 1.
Example that runs myscript.sh
, and redirects all STDERR
to STDOUT
so you can use a
pager.
$ ./myscript.sh 2>&1 | less
The important part is 2>&1
, which says STDERR
, which is 2, should be redirected to
STDOUT
, which is 1.