From: Bob Harris <harris@zk3.dec.com>
To: Usman Muzaffar <usman@thynne.psych.nwu.edu>
Subject: Re: no /dev/stderr ?
Date: 2000/02/24 [thread overview]
Message-ID: <240220000949047167%harris@zk3.dec.com> (raw)
In-Reply-To: 38B48886.6AB7691C@thynne.psych.nwux.edu
[[ This message was both posted and mailed: see
the "To," "Cc," and "Newsgroups" headers for details. ]]
In article <38B48886.6AB7691C@thynne.psych.nwux.edu>, Usman Muzaffar
<usman@thynne.psych.nwux.edu> wrote:
>Tru64 4.0 - I can't see a /dev/stderr in the device
>hierarchy. On other unices (linux, solaris) it's usually
>a symlink to the device that corresponds to fd 2.
>Can I create it myself?
>
>Isn't this POSIXish? Say I have a Bourne shell script
>whose output I want to direct to stderr or a file or
>/dev/null, depending on a switch. How can I do it if
>there's no way to reference /dev/stderr ?
In the Bourne or Korn shells if you want to redirect I/O to stderr, you
do the following:
command args 1>&2
if you want to direct both stderr and stdout into a file you do the
following in the following order:
command args >file 2>&1
/dev/stderr is _NOT_ a standard. /dev/console, /dev/null, and /dev/tty
are standards. Those are the only 3 /dev/ devices that I can find in
the standard. You can read the Open Group X/Open standards on-line
with a free registration at:
<http://www.opengroup.org/online-pubs?DOC=007908799>
next prev parent reply other threads:[~2000-02-24 5:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-23 5:00 no /dev/stderr ? Usman Muzaffar
2000-02-24 5:00 ` Bob Harris [this message]
2000-02-25 5:00 ` Timo Felbinger
2000-02-25 5:00 ` Bob Harris
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox