Wednesday, August 28, 2013

IO Redirection - Swapping stdout and stderr (Advanced)

% (sh myscript.sh 3>&2 2>&1 1>&3) 2>/dev/null
I'm stderr
% (sh myscript.sh 3>&2 2>&1 1>&3) >/dev/null 
I'm stdout

No comments:

Post a Comment