passes shell script error

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

passes shell script error Tue Jun 07, 2022 7:47 am • by awaldraff
Hello!

I have used the following script for several years to test a PDF for encryption. Moved to a M1 Mac and it stopped working

qpdf --requires-password "$1"
if [[ $? = 3 ]]; then
exit 0
else
exit 1
fi

QPDF is installed and if I run it on terminal it works perfectly and answers with a code = 3
I tried reversing the exit codes in the if statement to see if the exit code was giving a wrong answer, but the if statement fails either way

What could be the error?
awaldraff
 
Posts: 32
Joined: Fri Sep 23, 2016 3:47 pm

Re: passes shell script error Tue Jun 07, 2022 10:02 am • by Mr_Noodle
Try specifying the full path to the qpdf binary.
Mr_Noodle
Site Admin
 
Posts: 11226
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support