home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!geraldo.cc.utexas.edu!ccwf.cc.utexas.edu!mandream
- From: mandream@ccwf.cc.utexas.edu
- Newsgroups: comp.unix.aix
- Subject: Change standard output within a shell script
- Date: 22 Jan 1993 23:48:42 GMT
- Organization: The University of Texas at Austin, Austin, Texas
- Lines: 22
- Distribution: world
- Message-ID: <1jq14qINNsbd@geraldo.cc.utexas.edu>
- Reply-To: mandream@ccwf.cc.utexas.edu
- NNTP-Posting-Host: happy.cc.utexas.edu
- Keywords: shell script cron
-
- How do you change the definition of standard output within a csh script?
- I have a shell script with a lot of "echo" commands and I want their
- output to automatically go to a different file every day. I don't want
- to have to type a bunch of redirection symbols.
-
- The shell script is running as a cron job. I tried to redirect the file
- as follows:
-
- 00 2 * * 1-5 ~admin/bkup.test > ~admin/bkup_report/`date +%b_%d_%Y` 2>&1
-
- But, when I did that, the output was put into a file with the name
-
- Fri Jan 22 02:00:00 CST 1993
-
- Instead of
-
- Jan_22_1993
-
- When I run the same command that I used in the cron at the normal ksh
- prompt (since cron runs in ksh), it does create the filename I want.
-
- Thanks in advance...
-