I am using the bash following script to look for string in files:
find $1 -name "$2" -exec grep -Hn "$3" {} \;
Sometimes this script failed on
grep: /proc/sysrq-trigger: Input/Output error
In order to solve this I first think to exclude this file from the find result. is it a good idea and if yes how can I do that ? Is there any other solution to avoid my script failing ?
You can exclude all
/procdirectory in find like this: