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