Can’t run an executable under Linux

I chmod 777’ed an executable and trying to execute it like this: /home/gandalf/./sample but it doesn’t work
/bin/bash: line 25: ./sample: Permission denied
What can be the problem?
Thanks.

Answer

Seems like ./sample is a wrapper script for something else, and is calling another script/program on line 25 that you do not have execute permissions to.

I would try to cat ./sample to see what is on (or around) line 25 that it would be calling.

If you don’t understand what is going on, you can post the contents of the script in your question and we’ll help you out.

Attribution
Source : Link , Question Author : Community , Answer Author : Zypher

Leave a Comment