Re: SOLVED: Capturing file descriptor 3, or alternatives.

2012-06-26 Thread Bill Freeman
On Tue, Jun 26, 2012 at 8:01 AM, Ben Scott wrote: > P.S. to the P.P.P.S.: > > On Tue, Jun 26, 2012 at 7:55 AM, Ben Scott wrote: >>  I kept trying this one-liner: >> >> ANSWER=$( ( dialog --output-fd 3 --inputbox 'Speak Friend and enter' 0 >> 0  > /dev/fd/4 ) 3>&1 4>&1 ) > >  This may make the red

Re: SOLVED: Capturing file descriptor 3, or alternatives.

2012-06-26 Thread Ben Scott
P.S. to the P.P.P.S.: On Tue, Jun 26, 2012 at 7:55 AM, Ben Scott wrote: >  I kept trying this one-liner: > > ANSWER=$( ( dialog --output-fd 3 --inputbox 'Speak Friend and enter' 0 > 0  > /dev/fd/4 ) 3>&1 4>&1 ) This may make the redirection I'm talking about clearer: ANSWER=$( ( dialog --outp

Re: SOLVED: Capturing file descriptor 3, or alternatives.

2012-06-26 Thread Ben Scott
P.P.P.S.: On Tue, Jun 26, 2012 at 7:36 AM, Ben Scott wrote: > http://pastebin.com/XdxWjpeU Ah-ha! I think I just figured out why I need the exec builtin. I kept trying this one-liner: ANSWER=$( ( dialog --output-fd 3 --inputbox 'Speak Friend and enter' 0 0 > /dev/fd/4 ) 3>&1 4>&1 ) Th

Re: SOLVED: Capturing file descriptor 3, or alternatives.

2012-06-26 Thread Ben Scott
On Mon, Jun 25, 2012 at 11:09 PM, Ben Scott wrote: > On Tue, Jun 19, 2012 at 4:34 PM, Bill Freeman wrote: >> What occurred to me is to send the final result to fd 3, which the >> shell would have to have opened before forking. ... > > http://pastebin.com/RGBuRw0e > It appears to work. P.P.S.:

Re: SOLVED: Capturing file descriptor 3, or alternatives.

2012-06-26 Thread Ben Scott
On Mon, Jun 25, 2012 at 11:09 PM, Ben Scott wrote: >> What occurred to me is to send the final result to fd 3, which the >> shell would have to have opened before forking. ... > > http://pastebin.com/RGBuRw0e P.S.: CAVEAT I should prolly make it explicit that I don't understand everything abo

SOLVED: Capturing file descriptor 3, or alternatives.

2012-06-25 Thread Ben Scott
On Tue, Jun 19, 2012 at 4:34 PM, Bill Freeman wrote: > What occurred to me is to send the final result to fd 3, which the > shell would have to have opened before forking. ... get bash(sh) > to build a pipe (unnamed) to the child process's fd 3, > and either exec that (when it comes) or stuff it i