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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -