[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] new special variable: test argument
From: |
Greg Wooledge |
Subject: |
Re: [patch] new special variable: test argument |
Date: |
Mon, 21 Dec 2015 08:27:09 -0500 |
User-agent: |
Mutt/1.4.2.3i |
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.
Re: [patch] new special variable: test argument, konsolebox, 2015/12/16