Re: Assignment with colons *should* be tilde expanded in POSIX mode

2021-11-02 Thread Chet Ramey

On 11/1/21 6:37 PM, Anders Kaseorg wrote:

As you know, POSIX requires tilde expansion following an an unquoted colon in 
an assignment [1]. A bug was reported [2] against bash 5.1-alpha that the 
tildes in

 $ echo foo=~:~
 foo=~:~

should not be expanded in POSIX mode, because this is not an assignment. That 
was fixed in 5.1-beta. However, that fix also seems to have broken the actual 
assignment

 $ foo=~:~
 $ echo "$foo"
 /home/anders:~

where both tildes should be expanded in POSIX mode, because this is an 
assignment.


Thanks for the report. I'll take a look and fix whatever is wrong.

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/



Assignment with colons *should* be tilde expanded in POSIX mode

2021-11-01 Thread Anders Kaseorg
As you know, POSIX requires tilde expansion following an an unquoted colon in 
an assignment [1]. A bug was reported [2] against bash 5.1-alpha that the 
tildes in

$ echo foo=~:~
foo=~:~

should not be expanded in POSIX mode, because this is not an assignment. That 
was fixed in 5.1-beta. However, that fix also seems to have broken the actual 
assignment

$ foo=~:~
$ echo "$foo"
/home/anders:~

where both tildes should be expanded in POSIX mode, because this is an 
assignment.

5.0.18 and 5.1-alpha gave the expected /home/anders:/home/anders, while 
5.1-beta, 5.1.8, and the devel branch incorrectly give /home/anders:~.

Anders

[1] 
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_01
[2] https://lists.gnu.org/archive/html/bug-bash/2020-07/msg00072.html