Stop data retention! Click here & act! Are you a webmaster and want to participate? Here you can find all necessary material for your website - Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:
Chris Karakas Online Forum Index Karakas Online
 FAQFAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Error: bad interpreter: No such file or directory



 
Post new topic   Reply to topic
   Chris Karakas Online Forum Index -> Linux Forum RSS Feed of this Forum
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea  View previous topic :: View next topic  
Author Message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6262
Location: Outer Space

PostPosted: Mon Mar 12, 2007 8:15 pm    Post subject: Error: bad interpreter: No such file or directory
Reply with quote

Question Problem: You try to run a script, say xxx.sh, and you get this error:

Code:

: bad interpreter: No such file or directory


No matter what you try, you keep getting this fantastic error!

Normally, scripts contain a first line like

Code:

#! /bin/sh


or

Code:

#! /usr/bin/perl


or similar. This is a "hint" as to which "interpreter" to use to run the script. Of course, if /bin/sh or /usr/bin/perl or whatever is not there, or is there but is not executable, then yes, it is a "bad interpreter". But what if all this seems OK and you still get that fantastic "bad interpreter" error?

Idea Reason: The file looks OK, but it is a DOS file!. This is often the case with Linux scripts supplied inside .zip files that contain some Java program. The author was kind enough to supply a xxx.bat and a xxx.sh start script for Windows and Linux respectively.

Now, if you unzip this in Windows, the xxx.bat will work fine. But if you unzip it in Linux, make xxx.sh executable and try to run it, you will get the above error.

Actually, vi warns about this in its status line: it prints a "[dos]" - but one gets blind to messages in the status line with time...

Arrow Solution: Just convert the file to "unix type" with:

Code:

dos2unix xxx.sh


and be happy! Very Happy
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea 
Display posts from previous:   
Post new topic   Reply to topic
   Chris Karakas Online Forum Index -> Linux Forum
Page 1 of 1
This page contains valid HTML 4.01 Transitional - click here to check it!
This page contains a valid CSS - click here to check it!

 

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group