Re: backtick to NOT set variable

From: Max Ivanov <ivanov.maxim_at_gmail.com>
Date: Fri, 20 May 2016 17:44:53 +0100

> What exactly is the behaviour you want:
>
> - don't exit on error, just keep exec'ing
> + do you just define "error" as the subprocess exiting anything else
> than 0 ?
> - but completely undefine the variable, in order for later tests such
> as importas to pick that up?
>
> Is that right, or have I missed something?

Pretty much yes. Don't set ENV variable to the output value of a prog
if prog exited with anything but 0 (== that is what I call error, but
commands in execline make distinction between error codes and "exit
due to signal", so backtick might need to do it too to be consistent)

Whether to unset variable on error or not I have no opinion. If env
var was present already and backtick is called to overwrite it,
somebody might prefer it to be left with previous value, but for
others natural behavior might be to undefine it.
Received on Fri May 20 2016 - 16:44:53 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC