zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Helmut Jarausch <jarausch@igpm.rwth-aachen.de>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: piping question
Date: Fri, 3 Oct 2014 16:42:00 +0200	[thread overview]
Message-ID: <CAHYJk3Rx9iBLgeeKcnnu4N-56CqsgNyNhJof5+_M8H0Y0BBi9Q@mail.gmail.com> (raw)
In-Reply-To: <1412259225.3798.0@numa-i>

On 2 October 2014 16:13, Helmut Jarausch <jarausch@igpm.rwth-aachen.de> 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


  parent reply	other threads:[~2014-10-03 14:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 14:13 Helmut Jarausch
2014-10-03  2:29 ` Bart Schaefer
     [not found]   ` <1412326536.9490.1@numa-i>
2014-10-03 15:04     ` Bart Schaefer
2014-10-03 13:36 ` Kurtis Rader
2014-10-03 14:42 ` Mikael Magnusson [this message]
2014-10-03 15:23   ` Bart Schaefer
2014-10-03 15:42     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYJk3Rx9iBLgeeKcnnu4N-56CqsgNyNhJof5+_M8H0Y0BBi9Q@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=jarausch@igpm.rwth-aachen.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).