[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redirection after braced block

From: Chet Ramey
Subject: Re: redirection after braced block
Date: Mon, 05 Oct 2009 16:29:11 -0400
User-agent: Thunderbird (Macintosh/20090812)

clemens fischer wrote:

> I have the following construct in a script:
>   ... a number of commands
>   {
>       ... a number of commands
>   } 2>&1 | ${prog_log} "${logfile}"
> It seems anything inside the braces is not seen by bash, and it doesn't
> show up in a "sh -x ..." trace, but ${prog_log} does.  I had debug
> echo's at the start of the block, they aren't triggered.

I don't know anything about your program or what else might be going on,
but set -x sends its output to stderr -- if you redirect fd 2, the trace
output is going to be redirected right along with it.


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]