home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / programm / 4503 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.5 KB

  1. Path: sparky!uunet!wupost!usc!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!news.u.washington.edu!glia!hawkeye
  2. From: hawkeye@glia.biostr.washington.edu (Ken Keys - TF Dude)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: Unix Programming Question
  5. Keywords: Unix
  6. Message-ID: <hawkeye.715300231@glia>
  7. Date: 31 Aug 92 22:30:31 GMT
  8. Article-I.D.: glia.hawkeye.715300231
  9. References: <1571@dcsc.dla.mil>
  10. Sender: news@u.washington.edu (USENET News System)
  11. Organization: University of Washington
  12. Lines: 27
  13.  
  14. In <1571@dcsc.dla.mil> cop3409@dcsc.dla.mil (Joseph NMN Delmedico) writes:
  15.  
  16. >I have a program that employs the following command :
  17.  
  18. >      system("ls -l /path1/??/n???????.?? > /path2/upload.lst")
  19.  
  20. >to give me a list of upload file from different directories for processing.
  21. >If there are no files present of this type, nothing needs to be done.
  22. >However when the program runs and there are no files present I get an
  23. >error message from the superuser saying the program was run and no files
  24. >were found.  Since program must be run many times throughout the day these
  25. >messages pile up in my mailbox and have to be deleted.
  26.  
  27. >  So my question is, is there any means of turning off this feature so I
  28. >don't have to waste time deleting these messages?
  29.  
  30. The error messages are printed on standard error, but you only redirected
  31. standard output.  Assuming your system() uses /bin/sh,
  32.  
  33.       system("ls -l /path1/??/n???????.?? > /path2/upload.lst 2>&1")
  34.  
  35. will do what you want.
  36. -- 
  37. --
  38. Ken Keys, aka Hawkeye
  39. Master of the Fugue
  40. kkeys@ucsd.edu or hawkeye@ucsd.edu
  41.