doesn't
/usr/local/bin/script.sh: line5: 50: No such file or directory.
mean that in the script called script.sh is an error on line number 5, and the error's number or something is 50 and means "no such file or directory"...at least that's what I'd say about that
so it means, as far as I can understand, that on the line 5 you try to use something that can't be found? so the problem is inside the script, not in it's place on filesystem or permissions..