Afficher un message
Vieux 14/03/2008, 22h12   #11
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: One file for "stout+sterror" and another for "sterror"; it's possible?

2008-03-14, 19:20(+00), luciosan:
[...]
> As you can see, the file log.txt is not similare the output without
> redirect...
>
> What do you think about?

[...]

Same as for tee: two processes writing concurrently to a file
(this time cmd and zsh) this will depend on many things like
timing and system scheduling.

You'd need a single process to take both the cmd's output and
errors, and even then, pipes won't do as pipes have buffers
which cause the writer not to block until the reader has read

Typically, if you have "cmd" doing:

echo foo
echo bar >&2
echo baz

and have cmd's stdout and stderr going to 2 pipes to a
"processing" command.

The system may let "cmd" output "foo", "bar" and "baz" before
"processing" has even started to read from any of its pipes.

Then "processing" has no way to know that it needs to read first
one line from its first pipe, then one from its second, then
another from the first...

--
Stéphane
  Réponse avec citation
 
Page generated in 0,04604 seconds with 9 queries