Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Perl like select()?



Josh Howard wrote:
>Is there any way, in a script, to use a "Perl-like" select() to
>associate stdout with a particular file, before the execution of the
>rest of the script?

	exec > file

permanently redirects stdout.  Any redirection can be used this way.

>                    For instance: I have a shell script that I want to 
>simply put ">log.file" at the top, and then start echo'ing and doing
>various output and expect everything to go to log.file,

Interestingly enough, that's the syntax I used for this operation when
designing a new shell from scratch[1].

-zefram

[1] The Elate shell.  It's proprietary and doesn't run on Unix, so don't
ask for it.



Messages sorted by: Reverse Date, Date, Thread, Author