[clug] shell stdout and stderr

Cameron Patrick cameron at patrick.wattle.id.au
Thu Dec 1 03:56:57 GMT 2005


Tony and Robyn Lewis wrote:

> In a bourne shell, I want to make all stderr (and stdout) go to files, 
> *from within that script* - i.e. the standard redirection won't cut
> it.

The exec command without a program given as an argument will let you
redirect your own FDs.

Try this, e.g.:
   exec >stdout_file 2>stderr_file <stdin_file

Cameron.


More information about the linux mailing list