From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11494 invoked by alias); 3 Oct 2014 13:36:57 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19207 Received: (qmail 12658 invoked from network); 3 Oct 2014 13:36:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=VwvZO9cmi8NIXv3E/4evbdWnxrQlEAk5+j5libgoDjI=; b=Ao2yh2SDVCXVHvYOCS9VxDfoheCBSGI4GWMfzx0t0azvF0Z8XgaFNm6LSCIFCyvDd9 YA5AjGnmuy8j2kY4PueuNgPoDSdbZ2xT2z957Y95KqDLZtrMSJ+9GUNiLnpUqF6iPf1L As2lf+dNEQpxBFcqZJUCqliBHCLfa8wIKEzb9UtxFa/aZkD/ecYzGaQpbmlxsSnDWRNS tvrCTo1uKh58EyzrQ5ef+e6DelzTUNlZUDTlwqLimeBJg0YSCZxu/Dh1pxjsVG31F9FU ZY80Su3L26suVG18U68b/DVvqbxHB/OM4px6+zhM94ECGT9RT9jRaJnyH1g2hUFqFLye 8z7g== X-Gm-Message-State: ALoCoQlUBCIcwu+8XuAiVbWBLFH9utU6m0u2kEXcICtKOdb4mspQo6ldPM0VUpR4whZZt0dpIjs/ MIME-Version: 1.0 X-Received: by 10.152.22.137 with SMTP id d9mr5955305laf.29.1412343400578; Fri, 03 Oct 2014 06:36:40 -0700 (PDT) In-Reply-To: <1412259225.3798.0@numa-i> References: <1412259225.3798.0@numa-i> Date: Fri, 3 Oct 2014 06:36:40 -0700 Message-ID: Subject: Re: piping question From: Kurtis Rader To: Helmut Jarausch Cc: Zsh Users Content-Type: multipart/alternative; boundary=089e0158b6f2b154f8050484d209 --089e0158b6f2b154f8050484d209 Content-Type: text/plain; charset=UTF-8 As Bart pointed out xterm is going to establish a new pty via the getpty(), posix_openpt() or equivalent API. It then attaches stdin, stdout, stderr to that pty before launching the shell or command specified by the -e option. By design there is no way to coerce xterm to act like a pipeline filter. In addition to Bart's suggestion you can leverage the /proc filesystem if you're doing this on Linux, *BSD, or other UNIX implementation that provides it. Your xmost script can examine /proc/$$/fd/0. If it isn't associated with a pty it can arrange for it to be the stdin of the command running in the new xterm. Specifics are left as an exercise for the student. On Thu, Oct 2, 2014 at 7:13 AM, 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. > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank --089e0158b6f2b154f8050484d209--