Microsoft – Windows / Cygwin – Error – $’\r’: command not found

Background

In Microsoft Windows, Launched Cygwin terminal mode and running a little bash shell script.

But, getting the error “$’\r’: command not found”

The \r is a dead giveaway, as it means there is something amiss with Line Character and Carriage Return.

Fix

To fix:

  • Launched Notepad++
  • Load the Bash Script File
  • Access the menu items “Edit\EOL Conversion\Unix Format”
  • Re-save file (File \ Save)

 

Addendum

Addendum – Thursday July 10th, 2014

Please try the following StackOverflow Q/A postings:

They discuss using dos2unix to accomplish same thing.  Crediting Roman Hocke and “me_and“.

 

6 thoughts on “Microsoft – Windows / Cygwin – Error – $’\r’: command not found

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s