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


Groups > gnu.bash.bug > #16585

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

From Oğuz <oguzismailuysal@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode
Date 2020-07-20 08:42 +0300
Message-ID <mailman.181.1595223741.24492.bug-bash@gnu.org> (permalink)
References <CAH7i3LqG=mnoiSbetxVdg3wqso5orGgMqQk70-UfJ=wcdf6uLQ@mail.gmail.com> <8ddc4816-f85e-97b3-5c51-9b55acdcaca5@case.edu> <CAH7i3LpXfj3p5tXS_4S_dxdvdLG_tNyBa-4bU=z0Xih1=Tr7OA@mail.gmail.com> <5f066ef0-1fed-ad5b-d564-490268d32427@case.edu> <CAH7i3LrExgAXnKkYfgZD_r3xzZ99q8dY6=K+q7KdKw9XjtpcZA@mail.gmail.com>

Show all headers | View raw


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

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


Thread

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode Oğuz <oguzismailuysal@gmail.com> - 2020-07-20 08:42 +0300

csiph-web