Scripting trouble

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am unable to run scripts on OSX.  Here is what I did:

I created a file script (no extensions) as follows:
   echo "Hello"

And then I save it.  After that I go to my shell and try running this
file and I get the following message:
   bash: /Users/Y/script: /usr/bin/perl: bad interpreter: Permission

Any idea what I am doing wrong, and how I can fix this?

Re: Scripting trouble

Quoted text here. Click to load it

Did you set your file to be executable with the 'chmod +x filename'
Does the /usr/bin/perl file exist and is executable?
Did you know that perl does not have an echo function?
Are you trying to run a perl program or a bash script?
What version of OSX are you running, and on what platform?

The answers to these questions may help someone help you.

Re: Scripting trouble

y wrote:

Quoted text here. Click to load it

Try running
    /usr/bin/perl -v
from the bash prompt.  If it says Permission denied, there's your culprit.

Site Timeline