Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: piping question

On Oct 4,  9:29pm, Christian Neukirchen wrote:
} Subject: Re: piping question
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:
} >         local procself=/proc/self
} >         procself=${procself:A}  # Resolve symlink to actual PID
} >         local stdin
} >         exec {stdin}<&0
} >         rxvt -e most "$@" $procself/fd/$stdin
} >         exec {stdin}<&-
} This works great with less -f, thanks!

Beware that whatever is on the left side of the pipe may not see EOF
when "less" exits, so you may need to arrange to interrupt it some
other way.

For who may be interested, the parent zsh is holding open the file
descriptor that serves as the read end of the pipe.  This happens only
if you backgroud the entire pipeline, e.g.

   cat /dev/zero | xmost &

The pipe here stays open in the parent shell until the whole job is done,
and trying to close it with <&- gives e.g.

  file descriptor 11 used by shell, not closed

So I think we still have a few bugs along the lines of workers/32171 and
32176 and perhaps 31919.

Messages sorted by: Reverse Date, Date, Thread, Author