[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk "\\" "(" strange behavior ...
From: |
Andreas Schwab |
Subject: |
Re: gawk "\\" "(" strange behavior ... |
Date: |
Wed, 08 Sep 2004 10:05:43 +0200 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
Jeff Chua <address@hidden> writes:
> this works ...
> echo ")" | awk '{print $0; gsub(/)/, "b"); print $0;}'
>
> this doesn't ...
> echo "(" | awk '{print $0; gsub(/(/, "b"); print $0;}'
>
>
>
> It works with /\(/ and /\)/, but why does /)/ works and not /(/ ?
Both are invalid regexps and you are invoking undefined behaviour.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Re: gawk "\\" "(" strange behavior ..., Andreas Schwab, 2004/09/07