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


Groups > gnu.bash.bug > #14727

Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs

Path csiph.com!goblin3!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs
Date Mon, 22 Oct 2018 12:54:42 +0700
Lines 25
Approved bug-bash@gnu.org
Message-ID <mailman.2569.1540187763.1284.bug-bash@gnu.org> (permalink)
References <CAMu=Brp3q_-GV2j7R+hbXZX8LLakhQGd1O0y64q0xB2UBRRO6g@mail.gmail.com> <CAM_8-CiC=2-wY+y9GpRutzuOhom3q5ayS54sdH=F_w106WMj4Q@mail.gmail.com> <20181019195026.mmtktfswn3evxvlw@eeg.ccf.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1540187764 18637 208.118.235.17 (22 Oct 2018 05:56:04 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash <bug-bash@gnu.org>
Envelope-to bug-bash@gnu.org
In-Reply-To <CAMu=Brp3q_-GV2j7R+hbXZX8LLakhQGd1O0y64q0xB2UBRRO6g@mail.gmail.com>
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2001:3c8:9009:181::2
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
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 <http://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>
Xref csiph.com gnu.bash.bug:14727

Show key headers only | View raw


    Date:        Fri, 19 Oct 2018 16:21:27 -0400
    From:        Grisha Levit <grishalevit@gmail.com>
    Message-ID:  <CAMu=Brp3q_-GV2j7R+hbXZX8LLakhQGd1O0y64q0xB2UBRRO6g@mail.gmail.com>

  | I guess it's a bit surprising that $_ is set to just the variable name
  | and not "the last argument to the previous command", which would be
  | the full assignment string.

Except that a var assign isn't a command at all, but something different, and
one could argue that with no command $_ should retain its value from whatever
was the last command.   But $_ has so many different uses in bash (and ksh93) 
and was a horrible botch in the first place (from when it was first added to 
ksh) so what it does isn't worth being concerned about - as best as can be
done, simply ignore it, and hope it eventually goes away....

kre

ps: it would be really nice if, in bash (and everywhere else) $_ could turn
into one of the magic vars which loses its special properties when unset.
Scripts that want to use $_ (if there are any, which I doubt) won't be
unsetting it and would continue to work, the rest of us (at least those of
us not insane enough to try and use it) could just "unset _" in .profile (etc)
and be done with it.

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


Thread

Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs Robert Elz <kre@munnari.OZ.AU> - 2018-10-22 12:54 +0700

csiph-web