Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cygwin command not found bad characters found in .bashrc 357\273\277

Tags:

bash

cygwin

I'm new to Cygwin, I just installed it and attempted to set some simple environment variables. However, when I open the command shell, I get the error "#357\273\277 command not found"

I found an article that discusses what the problem is and how to "discover" the hidden bad character: http://mblog.lib.umich.edu/DataDiscussions/archives/2010/01/index.html but I don't know how to resolve the issue by removing the character (which I validated was a problem in my .bashrc file using the od command). I attempted to change the preferences view in Notepad++ to UTF-8 and ANSI to no avail, but the file was not altered at all.

Any help would be appreciated...

like image 780
mytwocents Avatar asked Jan 13 '11 01:01

mytwocents


2 Answers

As far as I know, a common problem with files saved in Notepad++ as UTF-8 and Cygwin is that Notepad++ saves UTF-8 encoded files with a byte order mark by default. This BOM character is not quite compatible with unix-like environments like Cygwin.

If you need unicode characters in these files, then you can try using the "UTF-8 without BOM" encoding in Notepad++, otherwise you can use ANSI or other encodings that don't use a BOM by default.

Besides the encoding, make sure the file's saved with unix (LF) line-breaks.

like image 126
Afz902k Avatar answered Sep 22 '22 15:09

Afz902k


Before feeding your files to cygwin bash, you can do a dos2unix conversion first to take care possible conflicts like CR LF. Open bash

name@host ~ $ dos2unix your_file.sh

like image 39
Peon the Great Avatar answered Sep 22 '22 15:09

Peon the Great