Im just wondering if there is any way to say 'if chmod does not change permissions of the file, then ...'
if ! chmod ${1} ${2} #if chmod did not excecute correctly
then
echo "${0}:ERROR: ${2} has not been changed." 1>&2
exit 6 #exiting due to failure. status 6
fi
I have tried this and several other ways but I can only add to the current setting rather than change it...
i.e if i start with -rwxr-xr-x i change it to -rwxrwxrwx
nothing else seems to work