cygwin syntax error: unexpected end of file

Hi,
I am getting error while running the script. "syntax error: unexpected end of file"

if i do cat i cant see the content of the script also it is showing as

 cat test.sh
doner /home/master/* /home/Priya/$i| while read i j

The original script is

paste /home/names.txt /home/ip.txt | while read i j
do
mkdir $i
cp -r /home/master/* /home/test/$i
done

Looks like your script's "lines" are terminated by carriage returns instead of line feeds.

Regards,
Alister

How i can remove the "carriage returns"

Could you try converting from windows format to unix format?

tr -d '\15\32' < winfile.sh > unixfile.sh

More info on
kb.iu.edu/data/acux.html

From the original post's output, it doesn't appear that there are any newlines (aka linefeed) ascii bytes (octal/decimal/hex 012/10/0x0A) in the script. If there were newlines, text from subsequent lines wouldn't overwrite that of previous lines. If this is the case, deleting carriage returns (octal 15) is not the correct solution. The carriage returns need to be translated to newlines.

Regards,
Alister

I resolved myself not used .sh instead i used .txt

QUOTE]I resolved myself not used .sh instead i used .txt
[/quote]

File extensions have no significance in unix or Linux, they are documentatry.

To check for carriage-returns, use this sed enquiry to make control characters visible:

sed -n l scriptname

Correctly terminated lines show as \n . Lines created on a Microsoft platform show as \r\n .