LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 10: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, 10:46 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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-15-2007, 12:16 AM   #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


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


All times are GMT -5. The time now is 01:14 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration