LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-19-2006, 11:56 PM   #1
ricka343
Member
 
Registered: Jun 2006
Posts: 54

Rep: Reputation: 15
problem in running shell script on linux '.sh'


[root@localhost ADRINBK]# ./zeus_bin/bin/zeus.sh -constraints=./zeus_bin/DISASTER_NEWS.dtd -outputDir=./zeus_bin/disa
bash: ./zeus_bin/bin/zeus.sh: /bin/sh^M: bad interpreter: No such file or directory



this is what i m getting
 
Old 06-20-2006, 12:06 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Looks like you edited this file in windows, so it contains a RET-EOL pair. Convert it with the dos2unix utility program, or use sed or tr or do a global replace in vim.

For example: "tr -d '^M' <oldfile >newfile"
To enter ^M in the shell or in vim, press [CTRL]-v[CTRL]-m.
 
Old 06-20-2006, 12:09 AM   #3
ricka343
Member
 
Registered: Jun 2006
Posts: 54

Original Poster
Rep: Reputation: 15
no it worked on other system with linux but not on my system
 
Old 06-20-2006, 12:59 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Where was "zeus_bin/bin/zeus.sh" edited?

There shouldn't be a '^M' at the end, and it is a signature of a msdos created or copied file. I believe running "tr -d '^M'" to remove these extra characters will fix the problem.

Last edited by jschiwal; 06-20-2006 at 02:53 AM. Reason: corrected typo,
 
Old 06-20-2006, 02:08 AM   #5
ricka343
Member
 
Registered: Jun 2006
Posts: 54

Original Poster
Rep: Reputation: 15
thanks jschiwal i got the output now ne way will disturb u in future too
 
  


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
aliases and the 'sh' shell koodoo Linux - Newbie 14 08-05-2006 04:19 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
Shell script running via crontab problem. thetruethugg Linux - Software 13 12-19-2003 08:56 PM
c/c++ running a shell script? thermalpants Programming 3 05-12-2002 11:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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