home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!psgrain!neon!jeff
- From: jeff@neon.rain.com (Jeff Beadles)
- Subject: Re: Am I writing to a tty or pipe?
- Message-ID: <BxnsIA.EGK@neon.rain.com>
- Reply-To: jeff@onion.rain.com (Jeff Beadles)
- References: <228@dinowine.huber.com>
- Date: Fri, 13 Nov 1992 14:34:56 GMT
- Lines: 17
-
- eddjp@dinowine.huber.com (Dewey Paciaffi) writes:
-
- >Is there a way to determine from within a Bourne shell script if
- >the output is being written to a tty or a pipe?
-
-
- By example:
-
- if [ -t 1 ] ; then
- echo "Stdout is a tty"
- else
- echo "Stdout is a pipe"
- fi
-
- -Jeff
- --
- Jeff Beadles jeff@onion.rain.com
-