Re: Redirecting an nohup to a file when it is an error
joe_at_invalid.address
Date: 05/14/04
- Next message: Xarky: "Interrupted System Call"
- Previous message: Ryan Gaffuri: "Redirecting an nohup to a file when it is an error"
- In reply to: Ryan Gaffuri: "Redirecting an nohup to a file when it is an error"
- Next in thread: Ryan Gaffuri: "Re: Redirecting an nohup to a file when it is an error"
- Reply: Ryan Gaffuri: "Re: Redirecting an nohup to a file when it is an error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 May 2004 15:00:46 GMT
rgaffuri@cox.net (Ryan Gaffuri) writes:
> My background jobs should result in an error. I want both the error
> and the standard out redirected to a given file. It says it is being
> redirected to nohup.out. This is in the korn shelll. Anyone know
> why?
...
> nohup run_script $ERROR_MSG_OPTION -u $LOGIN_FILE_NAME param1 2>&1 >
> myfile.log;
The order of redirection is important here. The above command
redirects stderr to stdout, then redirects stdout to a file, which
leaves stderr pointing at where stdout was. You need to do it this
way:
nohup run_script $ERROR_MSG_OPTION -u $LOGIN_FILE_NAME param1 > myfile.log 2>&1
This points stdout to the file, then points stderr to where stdout
currently goes (the file).
Joe
-- "Surprise me" - Yogi Berra when asked where he wanted to be buried.
- Next message: Xarky: "Interrupted System Call"
- Previous message: Ryan Gaffuri: "Redirecting an nohup to a file when it is an error"
- In reply to: Ryan Gaffuri: "Redirecting an nohup to a file when it is an error"
- Next in thread: Ryan Gaffuri: "Re: Redirecting an nohup to a file when it is an error"
- Reply: Ryan Gaffuri: "Re: Redirecting an nohup to a file when it is an error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|