[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [language-experts] bash --version 4.4.12(1)

From: Niels Möller
Subject: Re: [language-experts] bash --version 4.4.12(1)
Date: Tue, 17 Oct 2017 22:56:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix)

étienne <address@hidden> writes:

> I drop you this email because I noted something on bash version 4.4.12(1),
> In advance i'm sorry if it is not relevant, or if it is not the
> appropriate email address.

If you really think the previous behaviour was useful and valuable,
please mail a bug report to the appropriate bash mailing list, with a
clear example (preferably in English) and a motivation.

> Suspense () {
> # si identique à une déjà sortie, on recommence
>     grep -q $res $1 && continue    # 2>/dev/null  # this redirection is
> sufficient to solve the "issue"
>     echo $res >> $1
> }

If we think about a shell function as a function rather than a macro,
using continue like this makes no sense to me.

I think your script will be much clearer if you use the function's exit
code, something like

  Suspense () {
    grep -q $res $1 && return 1;
    echo $res >> $1

And inside the loop, invoke it like

  Suspense || continue

It might also be relevant to check what the posix standard on /bin/sh
says about continue. I'd guess that the old behaviour to be a bash
extension, and likely an unintended extension.


Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]