home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / shell / 4615 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.0 KB  |  35 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!nucsrl!ddsw1!dattier
  3. From: dattier@ddsw1.mcs.com (DWT)
  4. Subject: Re: how to tell if command outputs or not
  5. Message-ID: <BxGrq1.Bq4@ddsw1.mcs.com>
  6. Date: Mon, 9 Nov 1992 19:34:48 GMT
  7. References: <1992Nov8.014859.2937@u.washington.edu>
  8. Organization: Contributor Account at ddsw1, Chicago, Illinois  60657
  9. Keywords: if, messages
  10. Lines: 23
  11.  
  12. micah@carson.u.washington.edu (Micah Anderson) wrote in
  13. <1992Nov8.014859.2937@u.washington.edu>:
  14.  
  15. | if messages /usr/spool/mail/$USER
  16. | then echo "yes"
  17. | else echo "no"
  18. | fi
  19. | exit 0
  20. | what I want that to do is if the command messages /usr/spool/mail/$USER
  21. | outputs anything then echo yes, but if it doesnt output anything,
  22. | then output no...
  23. | what would the syntax for this be?
  24.  
  25. if test -n "`messages /usr/spool/mail/$USER`"
  26. then echo yes
  27. else echo no
  28. fi
  29. exit 0
  30.  
  31. David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
  32. dattier@ddsw1.mcs.com    CompuServe: 73720,1570    MCI Mail: 426-1818
  33.