3

I am trying to run a shell script on unix, but I am getting an error specifying it can't be executed.

Command

Unix> Abc.ksh
ksh: Abc.ksh: cannot execute

Also tried

pcasvs17 >  ./Abc.ksh
ksh: ./Abc.ksh: cannot execute

The script starts with

 #!/bin/ksh

Any help is appreciated.

1 Answer 1

8

chmod +x Abc.ksh and try again with ./Abc.ksh

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks Mate , it worked. I'll accept the anwer.The access available before was -rw-r--r-- , after running the command the access available was -rwxr-xr--
Can you explain why we need to do that?
the x means "executable". Before the chmod command, the file could be Read and Written, but not eXecuted (not even by the person who wrote it)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.