I have set -e
turned on for my script. The only thing is there is one command here that I don't want causing the script to exit if it fails, but I want everything else to do that. How can I keep set -e
on, and not have my script exit when an error code is thrown?
script in question:
native=$(pacman -Qenq -)
If stdin has a non-native package name an error code gets written to stdin.
pacman -Qenq -
is run withstdin
holding a foreign packagenative
ends up being unset.-x
output shows it being set (to an empty string, but set).set -e
turned on for the script.