On Mon, Dec 21, 2015 at 2:27 PM, Greg Wooledge wrote:
>
> 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.
On Mon, Dec 21, 2015 at 2:21 PM, Greg Wooledge wrote:
> On Sat, Dec 19, 2015 at 12:58:41AM +0100, Piotr Grzybowski wrote:
>> #2
>> touch /tmp/`date +%s`; if [ -f /tmp/`date +%s` ]; then echo "ok: $^"; fi;
>
> This is both wrong (insecure) and clumsy. You can't create a temp file
> this way. [..]
On Sat, Dec 19, 2015 at 01:03:35AM +0100, Piotr Grzybowski wrote:
> On Wed, Dec 16, 2015 at 7:36 PM, Stephane Chazelas
> 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 C
On Sat, Dec 19, 2015 at 12:58:41AM +0100, Piotr Grzybowski wrote:
> #2
> touch /tmp/`date +%s`; if [ -f /tmp/`date +%s` ]; then echo "ok: $^"; fi;
This is both wrong (insecure) and clumsy. You can't create a temp file
this way. If the file already existed, then you're using someone else's
booby
thanks for the answer Stephane; dont get me wrong, I do understand that
using another variable removes the need for some special variables (do you
need $REPLY if you can always use "read v" and be happy with it?). Dont you
think it makes sense what Konsolebox has written?
sincerely,
pg
El 19/12/20
El 19/12/2015 03:46, "Stephane Chazelas"
escribió:
>
> 2015-12-19 00:58:41 +0100, Piotr Grzybowski:
> > [..]
> > Without $^ it begins to look terrible.
>
> Using a variable is the most obvious thing to do.
not always practical.
>
> Also, what if "new_index" was a function which does call "[ -f"
2015-12-19 00:58:41 +0100, Piotr Grzybowski:
> Thanks for taking time to answer. Of course it is the issue of
> programming style (isnt it true that most things can be brought down
> to the programming style?), two real-life examples (stripped-down of
> everything):
>
> #1
> if [ -f ${output}/${b
On Wed, Dec 16, 2015 at 8:44 PM, konsolebox wrote:
>
> Just my quick thoughts:
>
> Pros:
> 1) It could make code smaller.
> 2) It could make writing code less prone to typos.
> 3) It could make writing code faster.
thanks. that was exactly the idea behind it.
> Cons:
> 1) The constant assignmen
Dear Stephane,
thanks.
On Wed, Dec 16, 2015 at 7:36 PM, Stephane Chazelas
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
Thanks for taking time to answer. Of course it is the issue of
programming style (isnt it true that most things can be brought down
to the programming style?), two real-life examples (stripped-down of
everything):
#1
if [ -f ${output}/${branch}/${index}/${current} ]; then
let current--;
for((i=
On Wed, Dec 16, 2015 at 11:03 PM, Piotr Grzybowski wrote:
> one thing I missed for some time now, is the ability to access the
> argument passed to test, or any argument on the right hand side.
> I needed it so I made a quick hack, which I attach as a reference.
> It allows to access arg in the
On 12/16/15 10:03 AM, Piotr Grzybowski wrote:
> Dear All,
>
> one thing I missed for some time now, is the ability to access the
> argument passed to test, or any argument on the right hand side.
> I needed it so I made a quick hack, which I attach as a reference.
> It allows to access arg in t
2015-12-16 16:03:14 +0100, Piotr Grzybowski:
> Dear All,
>
> one thing I missed for some time now, is the ability to access the
> argument passed to test, or any argument on the right hand side.
> I needed it so I made a quick hack, which I attach as a reference.
> It allows to access arg in th
Dear All,
one thing I missed for some time now, is the ability to access the
argument passed to test, or any argument on the right hand side.
I needed it so I made a quick hack, which I attach as a reference.
It allows to access arg in the the -f $arg easily, e.g.:
[ -f /tmp/myfile ] && { echo
14 matches
Mail list logo