quoted print?

Eric Dantan Rzewnicki rzewnickie at RFA.ORG
Tue Nov 9 22:58:09 GMT 2004


On Tue, Nov 09, 2004 at 10:09:10AM -0300, Leonardo Helman wrote:
> Probably you want something like:
>
> #!/bin/sh
>
> (echo This is a script
>
> exec 2>&1
>
> echo This is line 1
> ls
> ypmatch wibble ecsinfo # This will produce stderr output
> echo This is the end.
> ) | tee file.log
>
>
> No spaces between first parenthesys and next char.

This executes the contents of the () in a subshell, correct?

from man bash:
   (list) list is executed in a subshell. Variable assignments and
          builtin commands that affect the shell's environment do not
          remain in effect after the command completes. The return
          status is the exit status of list.

So everything but the pipe to tee goes inside the ()? I'm not trying to
be pedantic here, just hoping to clarify my own understanding.

Thanks,
Eric Rz.

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).




More information about the MailScanner mailing list