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

Re: Redirecting shell output to a pipe



On Wednesday 25 November 2009 07:48:01 Nadav Har'El wrote:
> On Tue, Nov 24, 2009, Peter Miller wrote about "Re: Redirecting shell 
output to a pipe":
> >...
> >
> > > Isn't it natural to assume that in the same fashion, you should
> > > also be able to redirect the scripts output to a pipe? E.g., a very
> > > useful idiom could have been
> > >
> > > 	exec | tee filename
> >
> > exec |& tee filename

you should replace exec with a command. NOT the "exec" builtin. using the 
builtin exec command doesn't make much sense in this context:

RIGHT:
    echo "Hello Pipe!" |& tee filename
or
    echo "Hello Pipe!" 2>&1 | tee filename


  WRONG:    exec | tee filename
  WRONG:    exec |& tee filename
  USELESS:  exec echo "Hello Pipe!" | tee filename
  USELESS:  exec echo "Hello Pipe!" |& tee filename



> 
> Does this work for you? I get (on zsh 4.3.10)
> 
> 	zsh: redirection with no command
> 
> This was exactly my "complaint" - that this is sensible syntax, that
> could have worked, but doesn't.
> 

Attachment: signature.asc
Description: This is a digitally signed message part.



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