Python Set remove() MethodThe remove() method removes the specified element from the set. This method is different from the discard() method, because the remove() method will raise an error if the specified item does not exist, and the discard() method will not.
set::erase() erase() function is used to remove elements from a container from the specified position or range.
So I have this at the start of a bash script file (-e and -o). However, in some functions, I would like for it to not exit out. Example
set -e
set -o pipefail
function check_status {
echo "Start Check"
docker exec mservice bash -c "echo 'Hello' | grep 'fail'"
echo "End check"
}
check_status
How can I prevent this from exiting out of the script - basically if I run this, it would printout "Start Check", but then exit because the next command returns a '1'.
I would like to be able to disable and enable the set -e/-o in multiple places or in different functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With