Bash Scripting Project exercise 2

Does anybody know why, when I run my script I am getting ‘Permission Denied’. So far all I’ve entered is the shebang line and the initial echo statement. Grateful for any pointers.

the most obvious thing to do would be to check the permissions:

ls -l

Thanks for your reply, when I run the above command I get:
$ ls -l -rw------- 1 ccuser ccuser 63 Oct 16 11:50

Which from my understanding means I have read and write permission, but doesn’t seem like I can run the file, which is the error I keep getting.
Have I missed something in the instructions, am I required to change the permissions to allow me to run this?

Anything you want to run/execute will need executable permission (x). You will need to add the permission:

chmod o+x


chmod 700

the first command adds executable permission (x) for owner (o)

the second sets all permission explicitly.


I’ve tried both commands and the second command works.
Thanks for your assistance

I just asked the same question and received this reply which has solved the problem -

If you give permission using bash it should resolve!