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

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
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 Mon, 20 Jul 2020 08:42:15 +0300
Lines 38
Approved bug-bash@gnu.org
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>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1595223742 10430 209.51.188.17 (20 Jul 2020 05:42:22 GMT)
X-Complaints-To action@cs.stanford.edu
Cc "bug-bash@gnu.org" <bug-bash@gnu.org>
To "chet.ramey@case.edu" <chet.ramey@case.edu>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=t4gE3yO5jinAQnesp8+77mBMWLqAKtwIHyWqbYghin0=; b=OcQDeu+E5F/rVxYca+ugR+iwMSF8z9+VuYgiC/z464g6aqD4GcReHYzO8EetWoHgHn sFPFh4MGgdI5Jqgrg2xor65HF/u3qcWfIR/2ydrIapY+PGWCjPl1qgc+XuwwdIuOFzIn dkvL6yfphGSpj31YRCGKMVJgKAf2bFm8mGyDkC70R946pLaKmbHbCw73Lw4bjYHDGsTi 6l25GW9zj8NlZTKlVrcN/9Ep6QIYDc4IyUkhQEBRcrZoVjXdOIPmMlP9yoX5ILEfcrTQ ZorxSwiN+5jtFitkTAsy9URDQYW37ES9tf/eSBuZNya82qrZBI9lSFHQQk3cxZPl8t0W LmSg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=t4gE3yO5jinAQnesp8+77mBMWLqAKtwIHyWqbYghin0=; b=IO4JZtFpttfE9CPdvsl51cHci4Xyq5fDqMl5LoDCKvChcfiyFECEOVk/MAVg6NhhHp TOei0DjpDSxnhG8h99FbiqIOUNCmYqISuz7cG67L62uJbPS1ehBsRJ9uL1Md0bbDIHeN 8dyoe0A4NS8CQK5elCuFxMJ8bUgwvqYIJi0ObxpE0KBtB5CtHvrAmzM++1QhRZGkMTJF Jt4dypEc7U4Vsp0Sfk+0dzg+W0IdPJ2u+c65y1uClM6mOq5p5XoHHFkDHpzJtSC5mPhm 1MYjpLc4C4Ze7duG0AOjzd6MJp5cDrTvOSnccYhJxfhJmP78byOg7INWpzJI5gQh4uM9 +nyg==
X-Gm-Message-State AOAM5312o8EDq3SM8sdqt14AfsL5Y0OXw6JvFeyYsjWWlDmoRj9bsR0L UzBqnzvM0jUlPKbKwfoRl4KFKokf3hx8uScDqLk=
X-Google-Smtp-Source ABdhPJw9kxAT1hmlX1mysxVlFmT79gp1u5a22BdcoUOFn7ds83w7xUKih7z+v0a+9IajAsZsEYWMJ2vIbav54MwMXnA=
X-Received by 2002:ac8:1907:: with SMTP id t7mr21764529qtj.160.1595223735972; Sun, 19 Jul 2020 22:42:15 -0700 (PDT)
In-Reply-To <5f066ef0-1fed-ad5b-d564-490268d32427@case.edu>
Received-SPF pass client-ip=2607:f8b0:4864:20::832; envelope-from=oguzismailuysal@gmail.com; helo=mail-qt1-x832.google.com
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -20
X-Spam_score -2.1
X-Spam_bar --
X-Spam_report (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no
X-Spam_action no action
X-Content-Filtered-By Mailman/MimeDel 2.1.23
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAH7i3LrExgAXnKkYfgZD_r3xzZ99q8dY6=K+q7KdKw9XjtpcZA@mail.gmail.com>
X-Mailman-Original-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>
Xref csiph.com gnu.bash.bug:16585

Show key headers only | 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