Cygwin Syntax Trouble

Posted by mkrouse on Super User See other posts from Super User or by mkrouse
Published on 2013-07-01T15:27:06Z Indexed on 2013/07/01 16:24 UTC
Read the original article Hit count: 290

Filed under:
|
|

I'm on windows 7 using Cygwin.

My script and text file are located in the same directory.

#!/bin/bash
while read name; do
echo "Name read from file - $name"
done < /home/Matt/servers.txt

I get this error and I don't know why because this is correct while loop syntax..?

u0146121@U0146121-TPD-A ~/Matt
$ ./script.sh
./script.sh: line 4: syntax error near unexpected token `done'
./script.sh: line 4: `done < /home/Matt/servers.txt'

Can anybody tell me what I'm doing wrong? I think it's because I'm on windows and using Cygwin.

© Super User or respective owner

Related posts about Windows

Related posts about bash