-w test on OS X gives command not found error
- by RobV
I'm writing a bash script which I'm testing on OS X though it will ultimately run on a standard Linux environment and running into a weird error.
I have tests like this in my script:
if [ ! -w $BP ]; then
echo "'$1' not writable"
exit 1
fi
Which seems pretty sane to me and works fine under Linux but when trying to test on OS X I get the following error message:
startSvr.sh: line 135: [: missing `]' startSvr.sh: line 135: -w:
command not found
So is this a case of OS X not supporting the -w test or is there some other reason this isn't working for me? e.g. environment