home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!opl.com!hri.com!spool.mu.edu!howland.reston.ans.net!usc!sdd.hp.com!news.cs.indiana.edu!babbage.ece.uc.edu!ucunix.san.uc.edu!ewilson
- From: ewilson@ucunix.san.uc.edu (Eliot Wilson)
- Newsgroups: comp.unix.aix
- Subject: Re: Change standard output within a shell script
- Keywords: shell script cron
- Message-ID: <C1J781.G4u@ucunix.san.uc.edu>
- Date: 27 Jan 93 21:19:12 GMT
- References: <1jq14qINNsbd@geraldo.cc.utexas.edu>
- Organization: University of Cincinnati
- Lines: 36
-
- In article <1jq14qINNsbd@geraldo.cc.utexas.edu> mandream@ccwf.cc.utexas.edu writes:
- >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...
-
- What I have done in the past using borne shell is this
-
- exec > /my.output.filename
-
- This cause stdout to change to this new file. Hope it helps.
- -ELiot
-
- --
- Eliot Wilson Univ. of Cincinnati UG Computer Science
- A-in't IBM Cincinnati AIX Open Systems Solution Team (a.k.a. limbo)
- I-t Internet: VNET:
- X-citing ewilson@ucunix.san.uc.edu supewils@DETVMIC1
-