[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] syntax error when setting RS via string concatenation
From: |
Ed Morton |
Subject: |
[bug-gawk] syntax error when setting RS via string concatenation |
Date: |
Mon, 9 May 2016 08:16:17 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 |
I didn't expect to get this syntax error when setting RS via string
concatenation:
$ awk 'BEGIN{RS="[x"; RS=RS"]"}'
awk: cmd. line:1: fatal: Unmatched [, [^, [:, [., or [=: /[x/
as opposed to setting it to a variable constructed by the same string
concatenation
$ awk 'BEGIN{t="[x"; t=t"]"; RS=t}'
$
Is that a bug or a feature (and if so, what feature?).
This was in bash on cygwin with:
$ awk --version
GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.3, GNU MP 6.0.0)
Regards,
Ed.
- [bug-gawk] syntax error when setting RS via string concatenation,
Ed Morton <=