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


Groups > gnu.bash.bug > #15062

Re: How to tell Bash multiple values are success?

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: How to tell Bash multiple values are success?
Date Wed, 19 Jun 2019 11:08:20 -0400
Lines 20
Approved bug-bash@gnu.org
Message-ID <mailman.459.1560957020.10840.bug-bash@gnu.org> (permalink)
References <CAH8yC8nj-JmJH_C+=6EPy7JmgG7JsOyx973DdMF6kTpcVAcZRg@mail.gmail.com> <20190619150820.GT2072@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 1560957021 21816 209.51.188.17 (19 Jun 2019 15:10:21 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To Jeffrey Walton <noloader@gmail.com>
Envelope-to bug-bash@gnu.org
Mail-Followup-To Jeffrey Walton <noloader@gmail.com>, bug-bash@gnu.org
Content-Disposition inline
In-Reply-To <CAH8yC8nj-JmJH_C+=6EPy7JmgG7JsOyx973DdMF6kTpcVAcZRg@mail.gmail.com>
User-Agent Mutt/1.10.1 (2018-07-13)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From 139.137.100.1
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
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 <https://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>
X-Mailman-Original-Message-ID <20190619150820.GT2072@eeg.ccf.org>
X-Mailman-Original-References <CAH8yC8nj-JmJH_C+=6EPy7JmgG7JsOyx973DdMF6kTpcVAcZRg@mail.gmail.com>
Xref csiph.com gnu.bash.bug:15062

Show key headers only | View raw


On Wed, Jun 19, 2019 at 11:01:46AM -0400, Jeffrey Walton wrote:
>     if dnf -y update &>/dev/null
>     then
>         echo "Upgraded system"
>     else
>         echo "Failed to upgrade system"
>         exit 1
>     fi
> 
> The problems seems to be 0, 100 and 200 are success. When updates are
> installed either 100 or 200 is returned. Confer,
> https://dnf.readthedocs.io/en/latest/command_ref.html .

dnf -y update >/dev/null 2>&1
rc=$?
case $rc in
  0|100|200) echo "Upgraded system";;
  *)         echo "Failed up upgrade system"; exit 1;;
esac

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


Thread

Re: How to tell Bash multiple values are success? Greg Wooledge <wooledg@eeg.ccf.org> - 2019-06-19 11:08 -0400

csiph-web