LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 11-27-2003, 07:01 PM   #1
linuxboy69
Member
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 138

Rep: Reputation: 15
bash: ./fam_mirror: bad interpreter: No such file or directory


bash: ./fam_mirror: bad interpreter: No such file or directory

I am getting this error I am getting when I try to run a script with

#!/usr/bin/perl

at the beginning of my script. Any idea what this means?
 
Old 11-29-2003, 11:48 AM   #2
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
Try:

stat /usr/bin/perl

If that says the file doesn't exist then the error is correct.

#!<file>
Is the start of a script, the file after the #! is the binary (executable) that interprets the script. You'll generally see either /usr/bin/sh or /usr/bin/bash or /usr/bin/perl

If you don't have perl you should install it. I'm surprised you don't though. try to type in:

which perl

If it finds anything, change the file after #! to point to the new one, or make a symmlink to /usr/bin/perl from whatever which found.
 
Old 12-01-2003, 10:37 AM   #3
linuxboy69
Member
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 138

Original Poster
Rep: Reputation: 15
File: "/usr/bin/perl"
Size: 797972 Blocks: 1568 IO Block: -4612029340933156864 Regular File
Device: 806h/2054d Inode: 32496 Links: 2
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: Mon Dec 1 09:30:00 2003
Modify: Tue Mar 26 12:30:20 2002
Change: Tue Nov 11 08:50:43 2003

This is what I get when I ran the command so there doesn't seem to be anything wrong with the file but thanks for your help. Any other idea's.

/usr/bin/perl

This is what I got when I ran which perl.

Last edited by linuxboy69; 12-01-2003 at 10:39 AM.
 
Old 12-01-2003, 06:46 PM   #4
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
Make sure you don't have any spaces before #!/usr/bin/perl or anywhere inside it.
Or any new lines before it.
Try running it as root too, and try just

#!/usr/bin/perl

That's it, with no commands. Does it still complain?
 
Old 12-12-2003, 01:32 PM   #5
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Rep: Reputation: 30
I'm having the same prob,

and I've already tried all your suggestions, yet the problem still exists.

Any new ideas?

Thank you
 
Old 12-22-2003, 11:35 AM   #6
mr349
LQ Newbie
 
Registered: Sep 2003
Posts: 1

Rep: Reputation: 0
Hey i had the same problem, and a bit more searching found this post which sorted it out for me:


You have DOS linefeeds in your file. Convert the file to Unix linefeeds, either by copying the file using ASCII mode FTP, or one of:

tr -d '\r' < script > script.new

perl -pi -e 's/\r$//;' script

dos2unix < script > script.new
 
  


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 ciberrust Linux - Networking 10 09-09-2010 06:51 AM
Bash: bad interpreter, permission denied jpantone Linux - General 22 05-27-2010 06:05 AM
: bad interpreter: No such file or directory lnx8 Linux - General 4 04-29-2004 02:56 AM
bash: ./myscript: bad interpreter: No such file or directory Stefangeelen Linux - Newbie 3 09-05-2002 01:50 AM


All times are GMT -5. The time now is 04:06 AM.

Main Menu
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