PDA

View Full Version : [SOLVED] bash: '/home/william/bin/Backup.py' permission denied



Wylkar
March 16th, 2008, 07:00 AM
I cannot execute a file that I put into my bin folder it will say "bash: '/home/william/bin/Backup.py' permission denied" and if I try as root it says that it cannot find the file. I have several files of the same type in the directory and some of them will work and some of them will come up with the same message as the one I just described.

ryanhaigh
March 16th, 2008, 07:06 AM
The files may not be executable, to change this:


chmod +x /home/william/bin/Backup.py

OR for all files in that directory


chmod +x /home/william/bin/*

You can also do it in the GUI by right clicking on the file, going into Properties>Permissions and allow executing file as a program.

Wylkar
March 16th, 2008, 07:16 AM
Thanks that worked.

Wylkar
March 16th, 2008, 07:28 AM
ok it will execute it but when I try it comes up with the syntax error:
william@william-desktop:~$ Backup.py
/home/william/bin/Backup.py: line 6: syntax error near unexpected token `('
/home/william/bin/Backup.py: line 6: `q = raw_input('Please enter the path to the file or folder you would like to backup:')'
this only happens when I try and run it as an executable.

slavik
March 16th, 2008, 07:32 AM
is the first line of your py file something like the following?

#!/usr/bin/python

ghostdog74
March 16th, 2008, 07:33 AM
show how your backup.py looks like

Wylkar
March 16th, 2008, 04:38 PM
I had forgotten to put '#!/usr/bin/python' in the front of the program. Thank you slavik for reminding me.