Afficher un message
Vieux 14/03/2008, 21h20   #10
luciosan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: One file for "stout+sterror" and another for "sterror"; it'spossible?

In article <slrnftlam6.dp1.stephane.chazelas@spam.is.invali d>
StephaneCHAZELAS <this.address@is.invalid> wrote:
> [CUT]
> setopt mult_ios
> cmd > log.txt 2>&1 2> error.log


This is my test.

zsh
setopt mult_ios
COUNTER=1
while [ $COUNTER -lt 11 ]; do
echo "${COUNTER} error" >&2
echo "${COUNTER} out" >&1
let COUNTER=COUNTER+1
done > log.txt 2>&1 2> error.log

The output on screen without redirect (without "> log.txt 2>&1 2>
error.log"):1 error
1 out
2 error
2 out
3 error
3 out
4 error
4 out
5 error
5 out
6 error
6 out
7 error
7 out
8 error
8 out
9 error
9 out
10 error
10 out

The output with your redirect:
cat log.txt
1 out
1 error
2 out
3 out
4 out
5 out
6 out
7 out
8 out
9 out
10 out
2 error
3 error
4 error
5 error
6 error
7 error
8 error
9 error
10 error

cat error.txt
1 error
2 error
3 error
4 error
5 error
6 error
7 error
8 error
9 error
10 error

As you can see, the file log.txt is not similare the output without
redirect...

What do you think about?

--
I'm using an evaluation license of nemo since 205 days.
You should really try it!
http://www.malcom-mac.com/nemo

  Réponse avec citation
 
Page generated in 0,05790 seconds with 9 queries