If this is an application you wrote, why not just have it write to stdout
and then redirect its output at the shell to wherever you want to put it. In
other words, instead of:

`app in1 in2 in3 output.file`

you'd have

`app in1 in2 in3 > output.file` (to output to a file named "output.file")

or

`app in1 in2 in3 1>&2` (to output to stderr)

On Wed, Dec 2, 2009 at 12:16 PM, McKown, John <[email protected]
> wrote:

> > -----Original Message-----
> > From: Linux on 390 Port [mailto:[email protected]] On
> > Behalf Of Rich Smrcina
> > Sent: Wednesday, December 02, 2009 10:48 AM
> > To: [email protected]
> > Subject: Re: Linux software development question
> >
> > stderr is filehandle 2.  To redirect it to a file use 2> on
> > the command
> > line:
> >
> > $ command <filein >fileout 2>errout
> >
>
> I must have said what I want to do exactly backwards. I don't want to
> direct stderr to a file. I want to tell an application to output to
> /dev/fd/2 instead of to a file. Well, hell, that's how to do it! In my
> application, the last file name in the parameter list is the output file
> name. So it cannot be omitted.
>
> app in1 in2 in3 output.file
>
> would become
>
> app in1 in2 in3 /dev/fd/2
>
> and I could do an fopen() on that, or just detect that as my convention and
> use file descriptor 3 directly. Stick me with a fork, I'm done!
>
> --
> John McKown
> Systems Engineer IV
> IT
>
> Administrative Services Group
>
> HealthMarkets(r)
>
> 9151 Boulevard 26 * N. Richland Hills * TX 76010
> (817) 255-3225 phone * (817)-961-6183 cell
> [email protected] * www.HealthMarkets.com
>
> Confidentiality Notice: This e-mail message may contain confidential or
> proprietary information. If you are not the intended recipient, please
> contact the sender by reply e-mail and destroy all copies of the original
> message. HealthMarkets(r) is the brand name for products underwritten and
> issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake
> Life Insurance Company(r), Mid-West National Life Insurance Company of
> TennesseeSM and The MEGA Life and Health Insurance Company.SM
>
>
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO LINUX-390 or
> visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390
>

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to