Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-31 Thread Chet Ramey
On 7/30/20 10:43 AM, Robert Elz wrote: > Date:Mon, 20 Jul 2020 10:11:59 -0400 > From:Chet Ramey > Message-ID: > > Sorry, didn't reply to this at the time... > > | You can make a case for the bash/ksh tilde expansion: the word > | expansion is ${PARAM:=WORD}, and

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-30 Thread Robert Elz
Date:Mon, 20 Jul 2020 10:11:59 -0400 From:Chet Ramey Message-ID: Sorry, didn't reply to this at the time... | You can make a case for the bash/ksh tilde expansion: the word | expansion is ${PARAM:=WORD}, and the WORD is subject to tilde expansion | according t

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-21 Thread Greg Wooledge
On Tue, Jul 21, 2020 at 03:14:59PM +0300, M. Nejat AYDIN wrote: > On 7/21/20 2:48 PM, Greg Wooledge wrote: > > On Tue, Jul 21, 2020 at 10:55:06AM +0300, M. Nejat AYDIN wrote: > > > Also, shouldn't the tilde be expanded following > > > $ echo ~: > > > ? The colon terminates tilde-prefix in an a

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-21 Thread M. Nejat AYDIN
On 7/21/20 2:48 PM, Greg Wooledge wrote: On Tue, Jul 21, 2020 at 10:55:06AM +0300, M. Nejat AYDIN wrote: Also, shouldn't the tilde be expanded following $ echo ~: ? The colon terminates tilde-prefix in an assignment, but there is no assignment involved here. Works for me. unicorn:~$ echo

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-21 Thread Greg Wooledge
On Tue, Jul 21, 2020 at 10:55:06AM +0300, M. Nejat AYDIN wrote: > Also, shouldn't the tilde be expanded following > $ echo ~: > ? The colon terminates tilde-prefix in an assignment, but there is no > assignment involved here. Works for me. unicorn:~$ echo ~: /home/greg: Also in POSIX mode.

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-20 Thread Chet Ramey
On 7/20/20 4:28 AM, Robert Elz wrote: > Date:Sun, 19 Jul 2020 15:21:07 -0400 > From:Chet Ramey > Message-ID: <5f066ef0-1fed-ad5b-d564-490268d32...@case.edu> > > | Maybe, but Posix says this isn't a variable assignment context, as POSIX > | defines variable assignm

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-20 Thread Robert Elz
Date:Sun, 19 Jul 2020 15:21:07 -0400 From:Chet Ramey Message-ID: <5f066ef0-1fed-ad5b-d564-490268d32...@case.edu> | Maybe, but Posix says this isn't a variable assignment context, as POSIX | defines variable assignments, and technically the shell shouldn't perform

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-19 Thread Oğuz
19 Temmuz 2020 Pazar tarihinde Chet Ramey yazdı: > On 7/19/20 1:47 AM, Oğuz wrote: > > By the way, > > wouldn't it be better if the same tilde expansion rules as with > assignment > > statements was applied to parameter expansions that assign default > values? > > Like, > > > > unset foo > >

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-19 Thread Chet Ramey
On 7/19/20 1:47 AM, Oğuz wrote: > By the way, > wouldn't it be better if the same tilde expansion rules as with assignment > statements was applied to parameter expansions that assign default values? > Like, > >     unset foo >     echo ${foo=~:~otheruser} > > assigns `/home/oguz:~otheruser' to `

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-18 Thread Oğuz
19 Temmuz 2020 Pazar tarihinde Chet Ramey yazdı: > On 7/18/20 1:38 AM, Oğuz wrote: > > See: > > > > $ set +k -o posix > > $ echo foo=~:~ > > foo=~:/home/oguz > > > > If I'm not misreading the standard `foo=~:~' should be printed > > verbatim, all shells I have except bash does so. > >

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-18 Thread Chet Ramey
On 7/18/20 1:38 AM, Oğuz wrote: > See: > > $ set +k -o posix > $ echo foo=~:~ > foo=~:/home/oguz > > If I'm not misreading the standard `foo=~:~' should be printed > verbatim, all shells I have except bash does so. Thanks for the report. This one has been around since bash-3.1. Chet

Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode

2020-07-17 Thread Oğuz
See: $ set +k -o posix $ echo foo=~:~ foo=~:/home/oguz If I'm not misreading the standard `foo=~:~' should be printed verbatim, all shells I have except bash does so. This is reproducible on 5.1 alpha too. Oğuz