[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Another ^A bug
From: |
Chet Ramey |
Subject: |
Re: Another ^A bug |
Date: |
Thu, 29 Nov 2018 15:31:10 -0800 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 11/20/18 9:24 AM, Martijn Dekker wrote:
> That ^A / $'\1' character just keeps causing trouble...
>
> This is a bug with IFS. Including a $'\1' character anywhere in IFS causes
> expansions in shell assignments to discard that character.
>
> $ bash -c "c=$'Y\1Y';
> for IFS in $'\1' $'\2' $'x\1' $'x\2' $'\1x' $'\2x'; do
> v=X\${c}X;
> printf %s \"\$v\" | od -a | awk 'NR==1 { \$1=\"\"; print }';
> done"
Thanks for the report. Cases like this never come up in the real world,
so edge cases like this slip by.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
- Another ^A bug, Martijn Dekker, 2018/11/20
- Re: Another ^A bug,
Chet Ramey <=