unix - How do I use my pager (more/less) on error output only -
i have program spits out both standard error , standard out, , want run pager less on standard error, ignore standard out. how do that?
update:
that's ... didn't want lose stdout ... keep out of pager
program 2>&1 >log | less
then later
less log
you try redirecting standard out /dev/null, redirecting standard error standard out used go.
example in ksh/bash:
program 2>&1 >/dev/null | less
here redirection 2>&1, sets file descriptor 2 (stderr) point same stream file descriptor 1 (stdout), gets evaluated before redirection >/dev/null , sets file descriptor 1 point /dev/null. effect write stderr gets sent stdout, , write stdout gets thrown away.
Comments
Post a Comment