How can one redirect stdout pipes and stderr pipes nn ksh on UNIX? (Not Linux).
The following works to redirect to files:
x=0
while [[ "$x" -lt 100 ]]; do
echo "junk" >&2
echo "$x log test"
echo "junk err" &>2
echo "$x err test" >&2
x=$(($x+1))
done 2>out1.err 1>out1.log
I’ve tried things to redirect pipes to other processes, like the following but this doesn’t work:
x=0
while [[ "$x" -lt 100 ]]; do
echo "junk" >&2
echo "$x log test"
echo "junk err" &>2
echo "$x err test" >&2
x=$(($x+1))
done 2>&3 | sort -u > out2.log 3>&1 | sort -u > out2.err
Process substitution: