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

Re: Perl like select()?



> 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, as opposed to
> doing something like "./script.sh >> log.file"

In the Bourne shell, you use "exec" with redirection and no command, 
thusly:

  #!/bin/zsh
  exec > /tmp/foo
  echo this is a test

And empirically, this works in zsh as well (3.0.5), although the section 
on "exec" in zshmisc(1) doesn't seem to imply that it should.

-j.



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