home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / aix / 13665 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  1.2 KB

  1. Path: sparky!uunet!cs.utexas.edu!geraldo.cc.utexas.edu!ccwf.cc.utexas.edu!mandream
  2. From: mandream@ccwf.cc.utexas.edu
  3. Newsgroups: comp.unix.aix
  4. Subject: Change standard output within a shell script
  5. Date: 22 Jan 1993 23:48:42 GMT
  6. Organization: The University of Texas at Austin, Austin, Texas
  7. Lines: 22
  8. Distribution: world
  9. Message-ID: <1jq14qINNsbd@geraldo.cc.utexas.edu>
  10. Reply-To: mandream@ccwf.cc.utexas.edu
  11. NNTP-Posting-Host: happy.cc.utexas.edu
  12. Keywords: shell script cron
  13.  
  14. How do you change the definition of standard output within a csh script?
  15. I have a shell script with a lot of "echo" commands and I want their
  16. output to automatically go to a different file every day.  I don't want
  17. to have to type a bunch of redirection symbols.
  18.  
  19. The shell script is running as a cron job.  I tried to redirect the file
  20. as follows:
  21.  
  22.    00 2 * * 1-5 ~admin/bkup.test > ~admin/bkup_report/`date +%b_%d_%Y` 2>&1
  23.  
  24. But, when I did that, the output was put into a file with the name
  25.  
  26.    Fri Jan 22 02:00:00 CST 1993
  27.  
  28. Instead of 
  29.  
  30.    Jan_22_1993
  31.  
  32. When I run the same command that I used in the cron at the normal ksh
  33. prompt (since cron runs in ksh), it does create the filename I want.
  34.  
  35. Thanks in advance...
  36.