quoted print?

Leonardo Helman mailscanner at LISTS.COM.AR
Wed Nov 10 11:41:36 GMT 2004


On Tue, Nov 09, 2004 at 05:57:47PM -0500, Eric Dantan Rzewnicki wrote:
> 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?
yes
nice feature to group commands

>
> 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.
all but | inside (), you could do "(xx) 2>&1 | tee also"


>
> 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).

------------------------ 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