On Mon, Aug 13, 2012 at 6:23 PM, Kurt Buff <[email protected]> wrote:
>>         foo 3>&1 1>&2 2>&3 3>&-
>> ... runs "foo" with stdout and stderr flipped.
>
> I've not run into the need to do that, and I think I'm grateful...

  Manipulating file descriptors can be useful.  One particular
application is using a program like dialog(1) to capture user response
out-of-band on a file descriptor you open for that purpose, while
still giving dialog(1) a working stdout and stderr.

        exec 4>&1

        ANSWER=$( ( dialog --output-fd 3 --inputbox 'Speak Friend and enter'
0 0 1>&4 ) 3>&1 )

  Granted, it's not exactly self-explanatory, but hey, this is nix
we're talking about.

> Besides, the default shell in FreeBSD is (t)csh, and it's what I stick
> with - don't even know if you can do that in tcsh.

  Prolly not.  I used to be a (t)csh user myself, and while I found
the syntax much less idiosyncratic, it's ultimately a dead end.  csh
is both rather limited and rather broken, and tcsh is still somewhat
of each.  Or so it was when I jumped ship to Bash, and I don't think
tcsh was being developed anymore.

-- Ben

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to