LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-14-2007, 09:00 AM   #1
yousmg
LQ Newbie
 
Registered: May 2007
Posts: 4

Rep: Reputation: 0
error with script iptables:bad intereptor


im working with java ( windows os) i have to generate a file.sh from my prject this file should be executed on a linux machine
when i copy this file under /usr/bin
and execute ./file.sh(i've changed the acces mode: chmod +rwx)
i m having error
:bad interptor:aucun fichier ou repertoire
my file.sh containe
#!/bin/sh
iptables -A INPUT -j ACCEPT
is it the prbleme that this file is generated on windows os?
 
Old 05-14-2007, 09:46 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Could be. The DOS/Win end-of-line is traditionally CR-LF, vs. simply LF in Unix. Look at the file with 'od', and see if there are '0D 0A' eol sequences. If so, this may be the problem. I use the editor 'nedit' to perform eol translation. There is certain to be other tools to perform the translation, probably even 'tr' will work. The only other possible problem that I see is that '/bin/sh' does not exist. This seems unlikely on any major Linux distribution.
--- rod.
 
Old 05-14-2007, 11:16 PM   #3
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
use:

dos2unix file.sh

regards.
 
  


Reply



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
init.d script error bad interpreter snowmedia Red Hat 8 10-01-2011 06:16 PM
ERROR AT MOUNTING USB :mount: wrong fs type, bad option, bad superblock on /dev/sda1, saiket Linux - Hardware 3 04-12-2008 12:07 AM
usb drive won't mount - error: wrong fs type, bad option, bad superblock on /dev/sda1 bluecog6 Linux - Hardware 4 01-27-2007 09:07 AM
iptables script error(?) 386 Linux - Networking 1 10-08-2005 01:56 PM
Expect script throws "open(slave pty): bad file number" error KNut Linux - Newbie 0 02-24-2004 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:04 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
Open Source Consulting | Domain Registration