I am trying to create an executable "Hello World" ruby file and I copied an existing, working executable "Hello World" ruby file and renamed it, but the new file does not have any executable permissions. The original file had the following permissions:
-rwxr-xr-x 1
The new file has the following permissions:
-rw-r--r-- 1
I have tried chmod -x [Filename] for the new file as well as sudo chmod, but nothing changes the file permissions. The file permissions remain:
-rw-r--r-- 1
Any attempt to execute the file understandably returns
bash: [filename]: Permission_denied

chattr. The immutable attribute would also prevent the super user from modifying the file. – STATUS_ACCESS_DENIED Apr 10 '11 at 13:58