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


Groups > gnu.bash.bug > #12062

Re: [patch] new special variable: test argument

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: [patch] new special variable: test argument
Date 2015-12-21 08:27 -0500
Message-ID <mailman.296.1450704436.843.bug-bash@gnu.org> (permalink)
References <CAP=cN8kxxnxRiJ7xz9hJUHVkLGQFJKxLE7Kz0fUpEFtSmcL9YQ@mail.gmail.com> <20151216183652.GA9276@chaz.gmail.com> <CAP=cN8=Fr5pPkWH5Qcn6P6=SQV3d+6YfNYX86S2X+DfV12A=XQ@mail.gmail.com>

Show all headers | View raw


On Sat, Dec 19, 2015 at 01:03:35AM +0100, Piotr Grzybowski wrote:
> On Wed, Dec 16, 2015 at 7:36 PM, Stephane Chazelas
> <stephane.chazelas@gmail.com> wrote:
> > What's wrong with
> >
> > f=/tmp/myfile; [ -f "$f" ] && { echo "$f is here"; head -n 1 < "$f"; }
> 
>  nothing. sometimes it is just not practical (see my answer to Chet's
> comment) and sometimes you just want to get that argument given to
> test.

If you are trying to advocate for a new feature in bash, it would behoove
you to use an example that ACTUALLY DEMONSTRATES how it would be useful.
Not a bogus example in which the feature is not only unnecessary, but
harmful as well.

All of the discussion I've seen so far points to the proposed new feature
being useful only in interactive shells, to save a tiny bit of typing
when someone is using commands that are quite unusual in interactive mode.

In a script, one would store the filename in a variable, every single time.

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


Thread

Re: [patch] new special variable: test argument Greg Wooledge <wooledg@eeg.ccf.org> - 2015-12-21 08:27 -0500

csiph-web