LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2006, 09:34 AM   #1
sumithnc
LQ Newbie
 
Registered: May 2006
Posts: 4

Rep: Reputation: 0
"bad interpreter: No such file or directory "


After running my shell scripts written in windows. I am getting : "bad interpreter: No such file or directory -"

how can i solve this thing..

I wanna learn linux badly ...help me guys .. Hilfe Hilfe
 
Old 05-15-2006, 10:39 AM   #2
tmillard
Member
 
Registered: Sep 2003
Distribution: Gentoo
Posts: 74

Rep: Reputation: 15
Please post the first line of your script. You can use a terminal window and type
Code:
head -n 1 SCRIPT.FILE
 
Old 05-15-2006, 10:39 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
Code:
perl -pi -e 's/\r//g' <scriptname>
This is due to stupid end of line war. Even text files have different format between mac/linux/windows...
 
Old 05-15-2006, 10:53 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
If you use a 'decent' editor in windows, the problem does not occur. I use PFE which can save files in UNIX format. There are other ones as well.
As an alternative, you can make a little sed-script that does the trick (very similar to nx5000's code).
 
Old 05-18-2006, 10:28 AM   #5
sumithnc
LQ Newbie
 
Registered: May 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Guys thanks a lot for replies ..

But still none worked.

What i did was :
1. Create a copy of the file .
2.Delete the file.
3. Recreate the file in linux using touch filname.
4.Then vi filename
#!/bin/sh

:wq

5.Then copy the contents of the old file into this..

6.Now the shell script works..
 
Old 05-19-2006, 01:05 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,357

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
May I suggest you save yourself a lot of time and just learn vi/vim ? ;-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bad interpreter: No such file or directory EcLip$e Linux - General 34 10-07-2013 03:11 AM
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 10 11-10-2010 01:19 AM
"Bad Interpreter -- command not found" when I run ./configure on Ubuntu -- Hoary Hedg GeoRanger Linux - Newbie 5 03-27-2006 01:52 AM
Installing Oracle Apps 11i in Redhat 9 - Linux "bad interpreter" error msoares Linux - Newbie 4 07-14-2004 09:45 PM
Installation problem "Bad Interpreter" SherylGlas Linux - Newbie 1 03-21-2003 02:06 PM


All times are GMT -5. The time now is 12:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration