home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!coplex!trebor!root
- From: root@trebor.uucp (Bob Stockler)
- Subject: Re: Am I writing to a tty or pipe?
- Organization: Bob Stockler
- Date: Wed, 18 Nov 1992 01:53:35 GMT
- Message-ID: <1992Nov18.015335.14478@trebor.uucp>
- References: <228@dinowine.huber.com> <Bxovv9.MBu@ddsw1.mcs.com> <229@dinowine.huber.com>
- Lines: 22
-
- eddjp@huber.com (Dewey Paciaffi) writes:
-
- >In article <Bxovv9.MBu@ddsw1.mcs.com>, dattier@ddsw1.mcs.com (DWT) writes:
- >|> eddjp@dinowine.huber.com (Dewey Paciaffi) wrote in <228@dinowine.huber.com>:
- >|>
- >|> | Is there a way to determine from within a Bourne shell script if
- >|> | the output is being written to a tty or a pipe?
- >|>
- >|> test -t
- >|>
- >|> or were you thinking of something that test -t doesn't answer?
- >|>
- >|> David W. Tamkin Box 59297 Northtown Station, Illinois 60659-0297
- >|> dattier@ddsw1.mcs.com CompuServe: 73720,1570 MCI Mail: 426-1818
-
- >That's exactly what I was looking for. Thanks to all who responded.
-
- It may have been what you were looking for, but it's not what you asked.
-
- The "test -t" tells if the file descriptor argument to it is a tty or not,
- but not if it is a pipe (or file or device or whatever).
-
-