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


Groups > gnu.bash.bug > #15061

How to tell Bash multiple values are success?

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Jeffrey Walton <noloader@gmail.com>
Newsgroups gnu.bash.bug
Subject How to tell Bash multiple values are success?
Date Wed, 19 Jun 2019 11:01:46 -0400
Lines 28
Approved bug-bash@gnu.org
Message-ID <mailman.458.1560956539.10840.bug-bash@gnu.org> (permalink)
References <CAH8yC8nj-JmJH_C+=6EPy7JmgG7JsOyx973DdMF6kTpcVAcZRg@mail.gmail.com>
Reply-To noloader@gmail.com
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
X-Trace usenet.stanford.edu 1560956539 21552 209.51.188.17 (19 Jun 2019 15:02:19 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=a7ywOLyD5p8BgloROLZjJnAnXVYhEJI7HNeUBs1ZVX4=; b=E6kR09WdxeFJgbEwvMTJETXuEUFE+S1fSrxJTns95DnMWbEq3QzfPA5p6x20b/GGE9 KVWWRj2rx/dbaCoZu8lYoaqaxkMY88HNBjVeMorwb0i4KP/pp8bB4cY25+4NoOH3Zrhr OXVzmYvZoKhQITM7YaQA7o+Mja6okmc7+tRJI41wGFz/W1USPb3a6O15FSwZTeeONBZ0 lhZWmLDdZdMTUek1J8jUghAS/Iv0uwSxkGUZcdNY2WWj072i5B1RIwaAUAFm2xbAxoCv 9PapYTkG4m4xxQ7sUASsNjWohbG4g3thXdbOHYJh1z5lGBG6V7+InASwcZxg/2zB7lca 2uDQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=a7ywOLyD5p8BgloROLZjJnAnXVYhEJI7HNeUBs1ZVX4=; b=sFSxLibY6gqIeTtHnrPGEa09+QHqZJ5uEFdZVWQ7stpTmIun1GC+evUJrVkLUfIr2V /mk5jo11yK6I532pTuDrlxOYJxJsSmlI2HucwJQGm/kJgRs9b+n1FrjdDPJ6hYcnMJ2D UHGnj+sq0+IBfRfxZAxcQ1rH6x6yu2WVzbX5pmtzfkNupN8qRhuLkSsnRLIfO356t2fV UFnyEkYGPnKR1k8xtXwtxrX2j1z6WL1dQr5GE3Rz1j7y8mQsRJ2D1DtdfKz0SAKZG4K8 K+tNTH5yiqVCwRPAWI5OJ/2uFwwI5au2SYJQoptDTeRvigg0ya0NCZWS2fC0aQ3oizv0 jwPA==
X-Gm-Message-State APjAAAXAFOypg/foNOVmHlrXfYdsDhuEBHsNzcfUV6nCbAXeDOUlJSmN 2XQzpyekuyU4n3+VUn34VsVlFuVse2sKw/YclSpMyDwK
X-Google-Smtp-Source APXvYqz4HzqHcftj6iAeUmdh0oyC7x07Kn9AwrMzHRk+VBnckF57DDv9KSI27zRXajm4a5A2XIvzoTZP3QapY3I+8OI=
X-Received by 2002:a02:ce50:: with SMTP id y16mr97613028jar.75.1560956519836; Wed, 19 Jun 2019 08:01:59 -0700 (PDT)
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2607:f8b0:4864:20::d2d
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 <CAH8yC8nj-JmJH_C+=6EPy7JmgG7JsOyx973DdMF6kTpcVAcZRg@mail.gmail.com>
Xref csiph.com gnu.bash.bug:15061

Show key headers only | View raw


Hi Everyone,

I have a systemd service that automatically applies updates. Looking
at the service history, the service reports failure when it installs
updates due to this:

    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 .

I looked through Bash Variables, but I did not see a way to signal the
information to Bash. Confer,
https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html
.

How do I tell Bash 0, 100 and 200 are success? (Or, how to tell Bash 1
is the only failure?)

Thanks in advance

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


Thread

How to tell Bash multiple values are success? Jeffrey Walton <noloader@gmail.com> - 2019-06-19 11:01 -0400

csiph-web