On 4/2/11 3:59 PM, Michael Witten wrote:
> Thus, bash has a bug.
>
> My guess is the nature of the problem is that the combination
> of the outer-most quotes (which would render most characters
> as literal) and the command substitution (which in some sense
> is probably parsed in a `top-level' c
Summary: I don't see the best way to (in bash) trap/handle an ERR
inside
a group-command "{}" that is in a pipeline. I have a way that seems
to
work, see "(F)", but little confidence that it's the best way, and
some
suspicion that the overall effort is misguided.
Detail:
I'd like to trap and hand
On Sat, 02 Apr 2011 15:20:23 +0200, Andreas Schwab wrote:
>> Could somebody please tell me what's going on here?
>
> Brace expansion.
>
> $ set -x
> $ echo "$(echo '"' | awk '{sub(/a/,$0)}')"
> ++ echo '"'
> ++ awk 'sub(/a/'
> awk: cmd. line:1: sub(/a/
> awk: cmd. line:1:^ unexpected newli
On Sat, Apr 2, 2011 at 08:20, Andreas Schwab wrote:
> Brace expansion.
HAH! :-D
Damn :-/
Michael Witten writes:
> Could somebody please tell me what's going on here?
Brace expansion.
$ set -x
$ echo "$(echo '"' | awk '{sub(/a/,$0)}')"
++ echo '"'
++ awk 'sub(/a/'
awk: cmd. line:1: sub(/a/
awk: cmd. line:1:^ unexpected newline or end of string
++ echo '"'
++ awk '$0)'
awk: $
Could somebody please tell me what's going on here?
First, here is a minimal example:
LINE|
| $ echo "$(echo '"' | awk '{sub(/a/,$0)}')"
0001| awk: cmd. line:1: sub(/a/
0002| awk: cmd. line:1:^ unexpected newline or end of string
0003| awk: $0)
0004| awk: ^ syntax error