Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?UTF-8?B?T8SfdXo=?= Newsgroups: gnu.bash.bug Subject: Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode Date: Sun, 19 Jul 2020 08:47:30 +0300 Lines: 41 Approved: bug-bash@gnu.org Message-ID: References: <8ddc4816-f85e-97b3-5c51-9b55acdcaca5@case.edu> 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 1595137656 9343 209.51.188.17 (19 Jul 2020 05:47:36 GMT) X-Complaints-To: action@cs.stanford.edu Cc: "bug-bash@gnu.org" To: "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=tCkyz/SrwQ7cNJJqwJTaoILMuU6oDCUO4VfVszUNev4=; b=l3o4wyAxkTPZI6h7wY0LsEqgKYjxTuQsD/SlcC+zh9lU66sjWYudbojClW314stjWe 0JC9/sRPHFHcrgngSHk/GrucxLzH/8h6luwI/Nwh/31nQJXLGZgaNLDvSS3Y/MK+GQdh FtIMFRi0Je+v5ODA85R0Htqgw8CzDKLDpAHCpk4BaJNsLn5wdno2VvZSSNSfarc82KeV MGj2DRc0sklV9oKv3Cnau3407ZTw9p8wXkT2TCa8UGaB0c+cHRE/9/CeSWDezj/mUfG7 8njSD6RbUvXC2kRPSaVHUL+TxRAqQmvsMMzYV0z86yAnI6XvdlDYLx3LHNEd199edEW3 uTnQ== 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=tCkyz/SrwQ7cNJJqwJTaoILMuU6oDCUO4VfVszUNev4=; b=q3Fo0PFLY4ZwWRucaX7f/RivEGCXt3R3ZGNpcqtb2awBZ6LHMMGzV3uo/gL+kh7jmM FYTRrYjA91s+H629+y93B12YNKm61JvUUyMp/CaqFONJbUq72UOtVK6QRiHwZq2F1eTd WP639H5yQ69KCi0Mhi4egbMb37Xzyd0j/tWuIkWhcCElb268/9fo58wDILzaydbmwG/W qLQS1laWB38tonC87vtZyXQ3QGAtlZGWXrfwJhJJvBclVr8gUyl8W3CNUy2Megpo18fN b1bj2Q1jddqjWxPpF2hG8ZE7ac8YTCFSPps9J4Qb3ddO3Ztgf/7pZuHu9HnKXudwg1l/ EFyQ== X-Gm-Message-State: AOAM533N6Hj7GbcsZyaw0ZOkn34ePIFEHGQcn1LA07eMO5uj7bAzJkBv 89UupHvkrHsqdywQgmHykfWRWWB5xk4/V4WKtYo= X-Google-Smtp-Source: ABdhPJzli+B6qPAAjWTnb7zvaiHJpmw3EyC+bor/iInk7PAa6Hy8jb56Wu+san8dIujAxGXvrABMZhYVQV7b7sNkq60= X-Received: by 2002:ac8:5048:: with SMTP id h8mr17597657qtm.81.1595137650468; Sat, 18 Jul 2020 22:47:30 -0700 (PDT) In-Reply-To: <8ddc4816-f85e-97b3-5c51-9b55acdcaca5@case.edu> Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=oguzismailuysal@gmail.com; helo=mail-qt1-x82d.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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <8ddc4816-f85e-97b3-5c51-9b55acdcaca5@case.edu> Xref: csiph.com gnu.bash.bug:16581 19 Temmuz 2020 Pazar tarihinde Chet Ramey yazd=C4=B1: > On 7/18/20 1:38 AM, O=C4=9Fuz wrote: > > See: > > > > $ set +k -o posix > > $ echo foo=3D~:~ > > foo=3D~:/home/oguz > > > > If I'm not misreading the standard `foo=3D~:~' 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. > > I guess it was such a trivial bug that no one cared to report. 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=3D~:~otheruser} assigns `/home/oguz:~otheruser' to `foo' regardless of whether `otheruser' is a valid login name for an existing user. I don't see any reason why it shouldn't assign `/home/oguz:/home/otheruser' instead. Yes, no one does that yet and there's not much real world use case for this feature, but this way it'd be more consistent with variable assignments, right? > Chet > > -- > ``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/ > --=20 O=C4=9Fuz