openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting » /usr/bin/python: Bad Interpreter: Permission Denied

Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 27-Oct-2007, 08:18
peter2007
Guest
 
Posts: n/a
Default

Hello,

I just installed the new openSuse10.3 (great modifications compared to the 10.2, which was really slow).

I still have a problem using the new version with my scripts (python, shell etc...). Using a
Code:
chmod +x myscript.py
In the first line of my script I fix the python path :
Code:
#!/usr/bin/python
When I try to execute the script using
Code:
./myscript.py
I get the following error message :
Code:
bash: ./myscript.py: /usr/bin/python: bad interpreter: Permission denied
I googled a lot around this stuff and I also tried executing the script like that being root, but it returns the same error. I turned of AppArmor (but nothing changed). I added an explicite exec option to my / partition in /etc/fstab...but nothing changed. Do I have to set Trusted Paths or what's the point?

Thanks in advance for your help.

Peter
  #2 (permalink)  
Old 27-Oct-2007, 14:42
ken_yap
Guest
 
Posts: n/a
Default

Did you edit the file with an editor that uses DOS line endings, i.e. CR NL? Or did the file come with DOS line endings? That would cause it.
  #3 (permalink)  
Old 27-Oct-2007, 15:50
peter2007
Guest
 
Posts: n/a
Default

Quote:
Did you edit the file with an editor that uses DOS line endings, i.e. CR NL? Or did the file come with DOS line endings? That would cause it.
[/b]
Thanks, I thought I already tried different line endings, but no So this resolved the problem. Nevertheless how can I transform line endings for all my existing scripts coming from ubuntu (I used kate under ubuntu to write all these scripts)? As I suppose all of them have DOS line endings.

Thanks.

Peter
  #4 (permalink)  
Old 27-Oct-2007, 15:56
ken_yap
Guest
 
Posts: n/a
Default

Use the dos2unix utility.
  #5 (permalink)  
Old 27-Oct-2007, 16:20
peter2007
Guest
 
Posts: n/a
Default

Quote:
Use the dos2unix utility.
[/b]
Thanks a lot ken_yap...
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2