bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Oğuz
Subject: Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode
Date: Mon, 20 Jul 2020 08:42:15 +0300

19 Temmuz 2020 Pazar tarihinde Chet Ramey <chet.ramey@case.edu> 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
> >     echo ${foo=~:~otheruser}
> >
> > assigns `/home/oguz:~otheruser' to `foo' regardless of whether
> `otheruser'
> > is a valid login name for an existing user.
>
> Maybe, but Posix says this isn't a variable assignment context, as POSIX
> defines variable assignments, and technically  the shell shouldn't perform
> tilde expansions after `=' or `:' at all. You could argue that bash has a
> bug here in that it expands the tilde after the `='.
>
>
Yes, apparently that's a bug too, which in my opinion needs to be fixed in
normal mode as well.


> --
> ``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/
>


-- 
Oğuz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]