Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-01-2006, 07:20 PM   #1
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30

im trying to execute a script to create IP tables
this whole thing started here

this is the script in question (i want this basic thing to work it has something ot do with this bash/sh stuffi think)

echo "Testing"

i go to the directory with this file and..

[root@vps local]# chmod a+x
[root@vps local]# ./
: bad interpreter: No such file or directory

i tried it also with /bin/sh and i got the same thing

both sh and bash exist inside /bin

this is on CentOS 4.2
Old 08-01-2006, 07:46 PM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Whenever I see somebody with the error "bad interpreter: No such file or directory" , I think they are creating/editing the file in Windows. I don't have Windows but, am able to make a text act like that and this is what it looks like...

bash: ./ /bin/sh: bad interpreter: No such file or directory

Then, I run this little diddy to convert it to Linux format ....
perl -i.bak -pe 's/\r\n/\012/'
Now, I try it again...

This is a test of my script
Old 08-01-2006, 07:52 PM   #3
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
wow it worked!

i guess i should write all that down?
Old 08-01-2006, 09:32 PM   #4
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
You should be able to change the way text is saved in the text editor you're using, from dos mode to unix mode.


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
Error when starting up snort: bash:!/bin/sh/usr/local/bin/snort :Eent not found cynthia_thomas Linux - Software 1 11-11-2005 02:59 PM
What is the difference between #!/bin/bash and #!/bin/sh? mTorbin Linux - Newbie 5 11-09-2005 12:10 PM
Change /bin/bash to /bin/zsh Smokey Slackware 12 07-14-2004 01:06 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM > Forums > Linux Forums > Linux - Software

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

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