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

Re: piping question



On 2 October 2014 16:13, Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx> wrote:
> Hi,
>
> I have a command 'most' which is similar to 'less'.
> Now I'd like to write a shell script 'xmost' which
> should do the same as 'most' but with its output sent to a newly
> generated xterm.
>
> If I say
>
> xterm -g 180x30+0+0  -hold -e most
>
> I cannot pipe into it anymore, like
>
> ls -l | xmost
>
> Can this be achieved?
>
> Many thanks for a hint,
> Helmt.

echo hi there | { xterm -e 'most <& 7' 7< <(cat) }

I forget the syntax right now for allocating an appropriate free fd,
but 7 should be free most of the time ;) It might also be possibly to
use some 7<&1 thing to avoid the extra cat, but 7<&1 isn't it.

-- 
Mikael Magnusson



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