• Post Reply Bookmark Topic Watch Topic
  • New Topic

/bin/sh^M: bad interpreter: No such file or directory  RSS feed

 
shyam sundarankam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

While I am executing one of the script in my environment related getting the below exception

/bin/sh^M: bad interpreter: No such file or directory
 
shyam sundarankam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have executed below command to resolve the issue

sed -i -e 's/\r$//' scriptname
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shyam sundarankam wrote:I have executed below command to resolve the issue

sed -i -e 's/\r$//' scriptname


Yeah. This is a common problem when sending text files from Windows or Mac. Unix/Linux even have a dedicated command to fix the files. Take a look at the "dos2unix" command.

Henry
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!