From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7567 invoked by alias); 5 Oct 2014 15:10:41 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33356 Received: (qmail 10259 invoked from network); 5 Oct 2014 15:10:38 -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=-0.5 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO, SPF_HELO_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Christian Neukirchen Subject: Re: piping question Date: Sun, 05 Oct 2014 17:10:21 +0200 Sender: chris@juno Message-ID: <87egumtuw2.fsf@gmail.com> References: <1412259225.3798.0@numa-i> <141003082330.ZM15100__40912.263657856$1412349949$gmane$org@torch.brasslantern.com> <87mw9bu94f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 141.84.9.5 In-Reply-To: (Mikael Magnusson's message of "Sun, 5 Oct 2014 14:17:49 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Mikael Magnusson writes: > On 4 October 2014 17:50, Christian Neukirchen wrote: >> Bart Schaefer writes: >> >>> On Oct 3, 4:42pm, Mikael Magnusson wrote: >>> } >>> } echo hi there | { xterm -e 'most <& 7' 7< <(cat) } >>> >>> I avoided that because I was concerned that some terminal emulators >>> would close all the descriptors above 2 when launching the command. >> >> Unfortunately, all these hacks don't work with urxvt. If anyone has an >> idea how to do it, I'd like to see. > > It works fine for me, the only difference is that it doesn't > automatically invoke the shell for you if you pass something that > isn't an array to pass to execv; > echo hi there | { urxvt -e sh -c 'most <& 7' 7< <(cat) } You are right! I'm down to xless() { { exec {stdin}<&0 exec urxvt -e sh -c "less ${(qq)@} <&$stdin" } &! } -- Christian Neukirchen http://chneukirchen.org