if [ "${backups[$service]:-NOT_HERE}" != "NOT_HERE" ]; then
# do what you want if the value does exist in the array
fi
from: https://stackoverflow.com/questions/44823572/get-an-element-from-a-associative-array-in-bash-with-set-u
In case if you want to check whether file does not contain a specific string, you can do it as follows. if ! grep -q SomeString "$File...
No comments:
Post a Comment