[Top][All Lists]

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

Re: declare overrides errexit

From: Jan Schampera
Subject: Re: declare overrides errexit
Date: Fri, 24 Sep 2010 06:41:14 +0200
User-agent: Mozilla-Thunderbird (X11/20100329)

Sascha Ziemann wrote:

        The following code prints "a". The second false terminates the script
but the first does not.
        set -e
        declare a="a"$(false)
        echo $a
        echo $b

The first operation succeeds, the second doesn't.

The first operation is the "declare" command, and it works (and will seit its exit code to 0).

The second operation is a variable assignment, the status of the variable assignment is != 0.

- first declare a
- then set a


reply via email to

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