home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!nucsrl!ddsw1!dattier
- From: dattier@ddsw1.mcs.com (DWT)
- Subject: Re: how to tell if command outputs or not
- Message-ID: <BxGrq1.Bq4@ddsw1.mcs.com>
- Date: Mon, 9 Nov 1992 19:34:48 GMT
- References: <1992Nov8.014859.2937@u.washington.edu>
- Organization: Contributor Account at ddsw1, Chicago, Illinois 60657
- Keywords: if, messages
- Lines: 23
-
- micah@carson.u.washington.edu (Micah Anderson) wrote in
- <1992Nov8.014859.2937@u.washington.edu>:
-
- | if messages /usr/spool/mail/$USER
- | then echo "yes"
- | else echo "no"
- | fi
- | exit 0
- |
- | what I want that to do is if the command messages /usr/spool/mail/$USER
- | outputs anything then echo yes, but if it doesnt output anything,
- | then output no...
- |
- | what would the syntax for this be?
-
- if test -n "`messages /usr/spool/mail/$USER`"
- then echo yes
- else echo no
- fi
- exit 0
-
- David W. Tamkin Box 59297 Northtown Station, Illinois 60659-0297
- dattier@ddsw1.mcs.com CompuServe: 73720,1570 MCI Mail: 426-1818
-