[eside-ghost] Duplicar descriptores
STenyaK (Bruno Gonzalez)
stenyak en gmail.com
Lun Oct 27 20:11:06 CET 2008
On Mon, Oct 27, 2008 at 17:59, Pablo Garaizar Sagarminaga
<garaizar en eside.deusto.es> wrote:
> Puedes trabajar con tee y tuberías con nombre (mkfifo). Mira este
> script, igual te da alguna idea:
>
> http://www.travishartwell.net/blog/2006/08/19_2220
Mil gracias, mkfifo ha servido! :-) He aquí una prueba de concepto,
con algun bug gordo incluido:
#!/bin/bash
test -z "$2" && echo 'Usage example: find foo | '$0' "grep bar" "grep
baz"' && exit
pipe=$(mktemp -u)
mkfifo $pipe
tee -a $pipe <&0 |$1 &
$2 <$pipe &
wait
rm $pipe
--
Saludos,
Bruno González
_______________________________________________
Msn/Jabber: stenyak AT gmail.com
ICQ: 153709484
http://www.stenyak.com
Más información sobre la lista de distribución eside-ghost