I'm having a few problems with running a Perl script. Every time I try to run it (its from a runescape launcher client), it give me the following message in terminal: Permission Denied
How can i fix this?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
There are two possibilities.
chmod +x script-name
Normally the first line of the script should be:
If it is, and if the script itself is executable, then try this:
if [ -x /usr/bin/perl ] ; then echo ok ; else echo OOPS ; fi
or, if your default shell is csh or tcsh:
sh -c 'if [ -x /usr/bin/perl ] ; then echo ok ; else echo OOPS ; fi'
If that prints
ok, then something very strange is going on. If it prints
OOPS, then your Perl interpreter is not executable -- which probably indicates that it was installed incorrectly. If that's the case, I'm not going to suggest a quick fix.
Another thought: Does the message result from executing the script itself, or from something it does?
Do you see the error when you execute the script from a command line? If so, if you add
near the top of the script does "Hello" appear before the "Permission denied" message? If so, then the problem is somewhere in the script (about which we have no information). You should be able to narrow it down yourself.