dougy147/scitopdf

"Conditional binary operator expected"

Closed this issue · 4 comments

Mac OS 12.0.1

/usr/local/bin/scitopdf: line 21: conditional binary operator expected
/usr/local/bin/scitopdf: line 21: syntax error near `READER'
/usr/local/bin/scitopdf: line 21: `[[ -v READER ]] || \'

This happens just running the script - with or without options.

Out of curiosity, could you provide your bash version ?

bash --version

Because it could be a bash compatibility problem.
According to sources I've come across, macOS is running a decade old version of bash.
If that's the problem, one would have to work on retrocompatibility (which I don't plan to).
Maybe you could try installing a newer version of bash :

Moreover, since Catalina (10.15), macOS default shell is zsh (which might cause compatibility problem too).
To test that, you can :

As I have no way to work on this script from macOS perspective, I let that issue open.
If some mac user can help, or create a new branch dedicated to macOS compatibility, that would be great.

After all that time, the last commit should fix this issue.

To check the existence of variables on old versions of bash needed to change -v $variable to ! -z ${variable+x} in the script. See that recent post for more infos.

Cheers