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

Re: piping question



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:

>     xmost() {
>       if [[ -t 0 ]]
>       then
>         rxvt -e most "$@"
>       else
>         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}<&-
>       fi
>     }
>
> I don't know about "most" so I didn't attempt to get the options
> right, but for "less" you need to add the -f option to be able to
> read the fifo.  Also note that if rxvt is put in the background,
> you need to avoid closing $stdin until after it finishes, so the
> best way to make this asynchronous is to add "&" after the "fi".

This works great with less -f, thanks!

-- 
Christian Neukirchen  <chneukirchen@xxxxxxxxx>  http://chneukirchen.org



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