syntax error near unexpected token `$'in\r''

David picture David · Jun 24, 2011 · Viewed 64.6k times · Source

I'm trying to compile the NIST Biometric Image Software, and I have been having trouble all day. I finally got the source checked out right, and I installed cygwin with no problems (I have used it in the past), but when I went to compile, I get this error:

 $  sh setup.sh </cygdrive/c/NBIS> [--without-X11]
 setup.sh: line 94: syntax error near unexpected token `$'in\r''
 'etup.sh: line 94: `    case $1 in

Now I'm sure any advanced coder would head to the setup.sh and look for problems, but I'm not really much of a coder (I'm only compiling this because there are no pre-compiled packages) so I don't know what to do. I didn't install any libraries with cygwin, I just left everything default. I'm trying to follow the NBIS manual, but I don't really understand it that well and so I'm struggling badly. Maybye taking a look at it you may notice something I missed: http://www.nist.gov/customcf/get_pdf.cfm?pub_id=51097

Answer

Jens picture Jens · May 4, 2012

That's a symptom of line-ending mismatch.

To convert setup.sh to Unix line endings on Cygwin, use

dos2unix setup.sh