On Wed, Apr 19, 2023 at 05:27:45PM +0200, Laszlo Ersek wrote:
Yes, I noticed that too, but I assumed there was a finer point I was missing. :/
Ah, it's not too relevant, but now I remember what was bothering me, about "!": if you embed the original construct in a "set -e" environment, it will exit with status 1 on the appropriate branch; but if you embed the "! ..." construct, it won't exit!
Indeed, that's another reason to be cautious about ! at a top level. Most uses of ! are inside conditionals (such as if ! ...; then' where set -e already can't touch), whereas this snippet is indeed at a top level,...
Anyway, the context is not like that here. We pass the command string to system(), and I understand "set -e" is not in effect there.
...but you are correct that system() does not use 'set -e' automatically. Then again, since shell snippes run in Makefile ARE supposed to use implicit set -e, it never hurts to be vigilant about context when looking at shell snippets embedded in a larger file. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org