unix - saving stdout, stderr and both into 3 separate files -


i using ksh. on link http://www.shelldorado.com/shelltips/advanced.html#redir , there example saving stdout, stderr , both 3 separate files.

((./program 2>&1 1>&3 | tee ~/err.txt) 3>&1 1>&2 | tee ~/out.txt) > ~/mix.txt 2>&1 

i tried getting below error:

ksh: syntax error: `(' unexpected 

please advice.

pretty works me:

$ ksh $ ps | grep "$$"  6987 pts/6    00:00:00 ksh $ cat program.sh #!/bin/sh  echo "err" 1>&2 echo "out" $ ((./program.sh 2>&1 1>&3 | tee err.txt) 3>&1 1>&2 | tee out.txt) > mix.txt 2>&1 $ cat out.txt out $ cat err.txt err $ cat mix.txt err out 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -