I have an individual.sh script that pipes standard error to a grep command, like this:FOUND=$(tesseract $i out -psm 0 |& grep -ci 'Orientation in degrees: [^0]')If I run the script like this I have no problems ./individual.sh filenameBut I want to pipe a bunch of files into the script. I am using this command to do so:find corpus/ -type f -exec ./individual.sh {} \;which is throwing this error from the line in individual.sh that redirects standard error. ./individual.sh: 7: ./individual.sh: Syntax error: & unexpectedHow do I redirect standard error while using the find -exec option
Using find -exec and having trouble with redirecting standard error
shell script;pipe;stderr
Maybe you're using zsh. Try adding as the first line of the file, #!/usr/bin/zsh.