[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - Pipe entre tres procesos



> > Pero hay que aclarar que es una redirección, no un pipe
> > 
> Eso es cierto. Pero para mi caso, funciona.

Hola,

Me alegro de que te haya servido.

Por otro lado, creo que convendría aclarar del todo la sintaxis de lo
que se hace en los ejemplos del info de tee.

Allí se dice, literalmente [1]:

     wget -O - http://example.com/dvd.iso \
       | tee >(sha1sum > dvd.sha1) > dvd.iso

   That makes `tee' write not just to the expected output file, but
also to a ___pipe___ running `sha1sum' and saving the final checksum in a
file named `dvd.sha1'.

   Note, however, that this example relies on a feature of modern
shells called "process substitution" (the `>(command)' syntax, above; 

En el Bash Reference Manual que tengo a mano (3.0, Julio 2004), "Process
Substitution" está situado bajo el epígrafe 3.5 "Shell Expansions", y
no en el 3.6 "Redirections", porque no es una redirección [2]:

Process substitution is supported on systems that support named
___pipes___ (FIFOs) or the '/dev/fd' method of naming open files. It
takes the form of
        <(list)
or
        >(list)
The process _list_ is run with its input or output connected to a FIFO
or some file in '/dev/fd'.
...
Note that no space may appear between the < or > and the left
parenthesis, ___otherwise the construct would be interpreted as a
redirection___.

He pensado que esto debía quedar algo más aclarado, por si alguien más
consulta este hilo, no haya lugar a confusiones.

Referencias:

[1] info coreutils (tee invocation::Redirect output to multiple files or 
    processes)
[2] Bash Reference Manual 3.0, Julio 2004, 3.5.6 "Process Substitution"

P.S. Siento las citas en inglés (si alguna persona necesita
traducción, sólo necesita pedirla).


Reply to: