LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Thread Tools
Old 09-19-2007, 06:15 AM   #16
sadashiv.linux
LQ Newbie
 
Registered: May 2005
Posts: 8
Thanked: 0

[Log in to get rid of this advertisement]
bad interpreter: No such file or directory

I also got above error; so I was looking going through this topic.
Just to add -- this error also comes when no perl is installed on your system.
While trying command "perl -i -pe's/\r$//;' <file name here>" I come to know about this Thanks!!!

Sadashiv
sadashiv.linux is offline     Reply With Quote
Old 02-26-2008, 12:09 AM   #17
cnschulz
LQ Newbie
 
Registered: Dec 2007
Posts: 2
Thanked: 0
Smile

Quote:
Originally Posted by mahantesh_hongal View Post
Dear wbrummet. Thanks a billion.

Your simple perl command (perl -i -pe's/\r$//;' <file name here>) clears up my issue

Thanks,
Mahantesh Hongal

thanks, your cr/lf suggestion is still helping people!



c.
cnschulz is offline     Reply With Quote
Old 04-22-2008, 03:17 AM   #18
deepdash
LQ Newbie
 
Registered: Apr 2008
Posts: 1
Thanked: 0
Thanks XunXu and wbrummet!

Both these worked -

dos2unix <filename>

perl -i -pe's/\r$//;' <filename>
deepdash is offline     Reply With Quote
Old 04-24-2008, 06:16 PM   #19
tieuphongvan
LQ Newbie
 
Registered: Apr 2008
Posts: 14
Thanked: 0
Talking

Either using the perl command:

Code:
perl -i -pe's/\r$//;' <file name here>
or trying to ftp the script from a Windows-based machine to a Unix-based machine while NOT under binary mode will do the job

Thanks to both wbrummet and timmeke!
tieuphongvan is offline     Reply With Quote
Old 06-16-2008, 06:06 PM   #20
peterlombardo
LQ Newbie
 
Registered: Nov 2006
Posts: 2
Thanked: 0
Quote:
Originally Posted by tieuphongvan View Post
Either using the perl command:

Code:
perl -i -pe's/\r$//;' <file name here>
or trying to ftp the script from a Windows-based machine to a Unix-based machine while NOT under binary mode will do the job

Thanks to both wbrummet and timmeke!
I had this issue which drove me nuts. I was familiar with dos2unix and the variations of line feeds...but still nothing fixed it and it still didn't execute.

As it turns out, the script I was trying to execute was on a external USB drive mounted with the 'noexec' option. doh! Move the script to local hard drive (mounted without 'noexec' obviously) and everything works...

Regards,
Peter
peterlombardo is offline     Reply With Quote
Old 11-14-2008, 04:16 PM   #21
gaurav.s.agrawal
LQ Newbie
 
Registered: Nov 2008
Posts: 5
Thanked: 0
I was facing the same problem and converting from dos to the uniz format did the trick
gaurav.s.agrawal is offline     Reply With Quote
Old 01-15-2009, 10:11 AM   #22
Samurai Unix
LQ Newbie
 
Registered: Jan 2009
Posts: 1
Thanked: 0
Quote:
Originally Posted by wbrummet View Post
I have run into this problem many times when editing scripts on a windows based system then FTP'ing them onto my servers. I simple Perl command always seems to clear up the problem. Try the following command on your text file then try and run it.

perl -i -pe's/\r$//;' <file name here>
Thanks. This script worked for me as well. What does it do?
Samurai Unix is offline     Reply With Quote
Old 03-19-2009, 10:47 AM   #23
irwinr
LQ Newbie
 
Registered: Dec 2004
Location: Texas
Distribution: Fedora Core 6, CentOS 4.4, CentOS 5
Posts: 14
Thanked: 0
Quote:
Originally Posted by timmeke View Post
A lot of the commands (using tr, perl, ...) posted here all do pretty much the same as the "dos2unix" utility mentioned. Please use this utility, as it was specifically created for this CR\LF issue.
Yes, dos2unix may be preferred, but it's not always installed. I ran into this issue today with a server that did not have a dos2unix command but did have perl installed, so the perl one liner here saved me a bit of time.

We should encourage alternative solutions, not discourage them.

-Jeremy
irwinr is offline     Reply With Quote
Old 03-19-2009, 12:10 PM   #24
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,268
Blog Entries: 3
Thanked: 29
Quote:
Originally Posted by Samurai Unix View Post
Thanks. This script worked for me as well. What does it do?
It changes line endings from windows to unix format.

Quote:
Originally Posted by irwinr View Post
We should encourage alternative solutions, not discourage them.

-Jeremy
The thread is dead. First message is from 2004.
ErV is offline     Reply With Quote
Old 03-19-2009, 12:22 PM   #25
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Hamburg, Germany
Distribution: SuSE 11.0, FreeBSD 6.0, openSolaris
Posts: 2,385
Thanked: 7
Quote:
Originally Posted by ErV View Post
...The thread is dead...
It's not, since you just posted .
JZL240I-U is offline     Reply With Quote
Old 03-20-2009, 01:16 PM   #26
tieuphongvan
LQ Newbie
 
Registered: Apr 2008
Posts: 14
Thanked: 0
Thumbs up

Quote:
Originally Posted by JZL240I-U View Post
It's not, since you just posted .
It took 1 yr for a good solution, and there are still people looking for the same solution after 5 yrs....Long live thread, woot
tieuphongvan is offline     Reply With Quote
Old 04-01-2009, 06:01 PM   #27
manishsingh4u
Member
 
Registered: Oct 2005
Location: Pune, India
Distribution: OpenSUSE 11.0
Posts: 422
Thanked: 0
Smile Thanks

This worked great.
Code:
perl -i -pe's/\r$//;' <file name here>
Thanks.

Manish
manishsingh4u is offline     Reply With Quote
Old 04-03-2009, 08:42 PM   #28
chrism01
Guru
 
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 5.4
Posts: 7,429
Thanked: 325
I'd be surprised if dos2unix is not part of the std install these days..
chrism01 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 ciberrust Linux - Networking 9 11-25-2004 03:09 PM
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 3 05-29-2004 06:59 PM
: bad interpreter: No such file or directory lnx8 Linux - General 4 04-29-2004 03:56 AM
bash: ./fam_mirror: bad interpreter: No such file or directory linuxboy69 Linux - Software 5 12-22-2003 12:35 PM
bash: ./myscript: bad interpreter: No such file or directory Stefangeelen Linux - Newbie 3 09-05-2002 02:50 AM


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

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration