Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14865

Re: Another ^A bug

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Another ^A bug
Date 2018-11-29 15:31 -0800
Organization ITS, Case Western Reserve University
Message-ID <mailman.4886.1543534283.1284.bug-bash@gnu.org> (permalink)
References <00a70034-ebcd-848b-4747-f507f95c6b00@inlv.org>

Show all headers | View raw


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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Another ^A bug Chet Ramey <chet.ramey@case.edu> - 2018-11-29 15:31 -0800

csiph-web