Re: set $'\001'; v=$* converted $'\001' to $'\001\001'

2018-01-17 Thread Chet Ramey
On 1/17/18 3:39 AM, Clark Wang wrote:
> On Mon, Jan 15, 2018 at 11:44 PM, Chet Ramey  > wrote:
> 
> On 1/15/18 1:26 AM, Clark Wang wrote:
> > See following example:
> >
> > [STEP 100] # echo $BASH_VERSION
> > 4.4.12(4)-release
> > [STEP 101] # set -- $'\001'
> > [STEP 102] # v=$*
> > [STEP 103] # printf '%q\n' "$v"
> > $'\001\001'
> > [STEP 104] #
> 
> Thanks for the report. This was fixed last month after a report from back
> in November. The fix is in the devel branch.
> 
> 
> Hi Chet, what kind of bug fixes can we expect to be backported to the
> current release branch (4.4)?

I have another batch waiting to be assembled into patches, mostly patches
I've already posted to the mailing list.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: set $'\001'; v=$* converted $'\001' to $'\001\001'

2018-01-17 Thread Clark Wang
On Mon, Jan 15, 2018 at 11:44 PM, Chet Ramey  wrote:

> On 1/15/18 1:26 AM, Clark Wang wrote:
> > See following example:
> >
> > [STEP 100] # echo $BASH_VERSION
> > 4.4.12(4)-release
> > [STEP 101] # set -- $'\001'
> > [STEP 102] # v=$*
> > [STEP 103] # printf '%q\n' "$v"
> > $'\001\001'
> > [STEP 104] #
>
> Thanks for the report. This was fixed last month after a report from back
> in November. The fix is in the devel branch.
>

Hi Chet, what kind of bug fixes can we expect to be backported to the
current release branch (4.4)?

-clark


Re: set $'\001'; v=$* converted $'\001' to $'\001\001'

2018-01-15 Thread Chet Ramey
On 1/15/18 1:26 AM, Clark Wang wrote:
> See following example:
> 
> [STEP 100] # echo $BASH_VERSION
> 4.4.12(4)-release
> [STEP 101] # set -- $'\001'
> [STEP 102] # v=$*
> [STEP 103] # printf '%q\n' "$v"
> $'\001\001'
> [STEP 104] #

Thanks for the report. This was fixed last month after a report from back
in November. The fix is in the devel branch.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: set $'\001'; v=$* converted $'\001' to $'\001\001'

2018-01-15 Thread Ilkka Virta

On 15.1. 08:26, Clark Wang wrote:

See following example:

[STEP 100] # echo $BASH_VERSION
4.4.12(4)-release
[STEP 101] # set -- $'\001'
[STEP 102] # v=$*
[STEP 103] # printf '%q\n' "$v"
$'\001\001'
[STEP 104] #


That looks like the same issue as this one from November:
Subject: foo=$*: ^A and DEL are prefixed or removed
http://lists.gnu.org/archive/html/bug-bash/2017-11/msg00107.html

If I read the commit message correctly, this looks like a fix for it:
http://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel=32dc2bf525399a80ef098bcf852331bc276c7ce8

--
Ilkka Virta / itvi...@iki.fi



Re: set $'\001'; v=$* converted $'\001' to $'\001\001'

2018-01-15 Thread Greg Wooledge
On Mon, Jan 15, 2018 at 02:26:19PM +0800, Clark Wang wrote:
> See following example:
> 
> [STEP 100] # echo $BASH_VERSION
> 4.4.12(4)-release
> [STEP 101] # set -- $'\001'
> [STEP 102] # v=$*
> [STEP 103] # printf '%q\n' "$v"
> $'\001\001'
> [STEP 104] #

Confirmed (with default IFS; it is important to note that).  And also
for the record, v="$*" gives the expected result.

wooledg:~$ v="$*"
wooledg:~$ printf '%q\n' "$v"
$'\001'

Just another case of "never ever EVER use unquoted $* or $@", for us
script writers.  Chet may still choose to address it as a bash bug,
of course.