bash - Grep and set -o errexit -
i have simple bash-script. finds string in file.
#/bin/bash set -o errexit grep 'findedstring' $file. echo "was founded string on file" <...>
if string found in file script executed , can see string "was founded string on file". if file don't has 'findedstring' script exited , didn't worked further, don't can see "was founded string on file" if delete string in script
'set -o errexit'
,the script work further , can see string "was founded string on file".
how can save string in script
'set -o errexit'
and script keep working when string not founded on file?
help me.
grep 'findedstring' $file. || true
Comments
Post a Comment