Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?UTF-8?B?T8SfdXo=?= Newsgroups: gnu.bash.bug Subject: Re: local failure Date: Sat, 30 May 2020 18:32:02 +0300 Lines: 69 Approved: bug-bash@gnu.org Message-ID: References: <87tuzzh34x.fsf@hobgoblin.ariadne.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1590852730 31162 209.51.188.17 (30 May 2020 15:32:10 GMT) X-Complaints-To: action@cs.stanford.edu Cc: "Dale R. Worley" , "bug-bash@gnu.org" , "bash@packages.debian.org" To: Laurent Picquet Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=513Lj9m5bkYpCAOIWpQ+pqffdvblARuM6d0w5fDROpk=; b=gVtgBwc5KN5oew0HE4Y39FVlEFxvx+nKcer88d1Ev8jp0Q9g9h/hUdBu0pbxWSXytQ m09uTzzoGMxRk8Pyh2pMIlUV6YYzl1yt4UbwZ1jF0ii6rmakQtyL+OFGVylEYMrgPkqB FE2Gw6+4vqktQqxvpQsRpmWVWv94vtm+WZ+ZNOn/ODfuQ04bKFq+5iKQSE1F3stBD1tH dWtXFAi//fm6k4Y0LweaHMuLsbqGQolRcGI+7YqoCqwuoU6wq7YP6tHo8c/XCh0Psp7G Bbfpevr1cTbBKQDJhkpQkUMXvfy5wVsJQPIsEHNMaObJgHActWR1KazwYRwdoTT2l3bC I6mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=513Lj9m5bkYpCAOIWpQ+pqffdvblARuM6d0w5fDROpk=; b=Tc4Bb9q5Di/KjQzI2QiuMwOKKIkcIWLiEL+gr3zSHZnFL7bx01fsbIqW2l/ZrRqX51 wyepM2lOi9KtvtD0uiNv8D0UPXVZiZtoAy1zadbCUn8ZGuKdBqx5ik75APKVEP5iVz41 fG9hHzKF3g5hOIpj7f5kT4LKllLoj7JXYBDa07zctnFRlpO3b2QjIXGiJFQqijekjwzw waO8af1TssppncDyU3vDfHQ1xuo4P4McbKnrlOI3G2zGNukVsjrWfK/mrlaM9EenvWLk rWyx6Aw4mJBqYE1M9tJggAEszxXCH9682JsHVMYLrAlIUySKDxbe5rTdBQZjlI1lLfJR 41lw== X-Gm-Message-State: AOAM531O14YyujoSOrPGlZ3dTzOIt7xPi2Wx0UqqQ5jdqOS4W2+Z+1bL HZPtYIQYLVjSJycWvDaVm+mSW5tPplIWzSuUcFY= X-Google-Smtp-Source: ABdhPJwPseCInNVuYC17EzcmQF4f5GQa8Q1c2QgjOZTig9kqao1Gd1SNtdFa/EC785vOJv0StNIFw5ktwOix2J4SEF8= X-Received: by 2002:ac8:1a46:: with SMTP id q6mr15264760qtk.338.1590852723488; Sat, 30 May 2020 08:32:03 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::82b; envelope-from=oguzismailuysal@gmail.com; helo=mail-qt1-x82b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_EXCESS_BASE64=0.979, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <87tuzzh34x.fsf@hobgoblin.ariadne.com> Xref: csiph.com gnu.bash.bug:16323 30 May=C4=B1s 2020 Cumartesi tarihinde Laurent Picquet yazd=C4=B1: > Hello Dale, > > This is really interesting. > Should the 'local' command be the one able to detect that the assignment = to > the variable had an non-zero exit code and return the non-zero exit code? > > as a developer, it is counter-intuitive that the 'local' command tells us > everything is ok when it wasn't. If feel it should know that the assignme= nt > encountered a problem and should report it > > Everything is ok for `local` though; it takes a valid assignment statement and successfully evaluates that. So it's not that the assignment encountered a problem, but that the expansion has failed, which has nothing to do with `local`. So there is no reason for `local` to return a non-zero exit status in that case. > The return status is zero unless local is used outside a function, an > invalid name is supplied, or name is a readonly variable. > > > > On Fri, 29 May 2020 at 03:43, Dale R. Worley wrote: > > > It's a subtle point. See this paragraph in the bash manual page: > > > > If there is a command name left after expansion, execution > > proceeds as described below. Otherwise, the command exits. If > > one of the expansions contained a command substitution, the exit > > status of the command is the exit status of the last command > > substitution performed. If there were no command substitutions, > > the command exits with a status of zero. > > > > In one of your examples, a "local" command is generated using a command > > substitution, so the exit status is that of the local command. In the > > other, only an assignment is done, which is not a command, so the exit > > status is that of the last command substitution. > > > > Dale > > > > > -- > > > -- > > Laurent Picquet > > 16, Hunters Chase > > South Godstone > > RH98HR > > England > > tel: 07882 356 104 > --=20 O=C4=9Fuz