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 01-24-2012, 11:54 AM   #1
cottonr
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Rep: Reputation: Disabled
Getting "bad interpreter: no such file or directory


I've got a script that was edited with Windows Notepad before being copied onto a machine with RHEL. The script fails with the following message:

/bin/sh^M: bad interpreter: no such file or directory

My suspicion is that Notepad put in a control character (^M) that RHEL is now trying to interpret as part of the name of the script interpreter. Can anyone confirm if that is the case, or suggest a different problem might be at the bottom of this?

Thanks.
 
Old 01-24-2012, 12:00 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
yes, just remove it, and try again.

Kind regards
 
1 members found this post helpful.
Old 01-24-2012, 12:01 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

Confirmed.

There are many ways to solve this, here are 2 that come to mind:
- Safe the file as normal ascii/text (seen from notepad that is),
- Use the dos2unix command in linux to convert the saved file.

Hope this helps
 
1 members found this post helpful.
Old 01-24-2012, 12:42 PM   #4
cottonr
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks!

Thanks to both of you. I used a combination of the suggestions you made and was able to get everything to work.
 
  


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" when configure "flex" acer_peri Linux - Software 10 11-10-2010 01:19 AM
: bad interpreter: No such file or directory ciberrust Linux - Networking 10 09-09-2010 06:51 AM
:bad interpreter: No such file or directory pradee.y5mc Linux - Newbie 1 08-17-2007 02:46 AM
: bad interpreter: No such file or directory User2 Linux - Software 2 06-03-2006 04:58 PM
"bad interpreter: No such file or directory " sumithnc Linux - Newbie 5 05-19-2006 01:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 PM.

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