# Line 13: Syntax error: Unexpected end of file



## myoung (Apr 3, 2009)

I keep receiving the following error message when trying to use this script in Cygwin. When use this same script within a Linux box the script works fine? Can anyone assist with this issue? 


```
#!/bin/bash 
cat file2.txt |while read line; do 
echo ${line} 
smbclient //${line}/c$ -W domain -U user%"password" << "EOF" 
cd "/Documents and Settings" 



ls 

done 
EOF
```


----------



## LateNiteTV (Apr 3, 2009)

why do you have EOF?


----------



## MG (Apr 4, 2009)

What are you trying to do? A script that creates another script?


```
#!/bin/bash

(
cat << EOF
#!/bin/sh
echo "test"
EOF
) > filename.txt
```

for EOF you can use any text.


----------



## SirDice (Apr 6, 2009)

LateNiteTV said:
			
		

> why do you have EOF?



It's called a HERE document:
http://en.wikipedia.org/wiki/Heredoc


----------



## SeanC (Apr 13, 2009)

myoung said:
			
		

> I keep receiving the following error message when trying to use this script in Cygwin. When use this same script within a Linux box the script works fine? Can anyone assist with this issue?
> 
> 
> ```
> ...



Not my area of expertise, but this looks odd. Shouldn't the quotes come after the forward-slash? 


```
cd /[color="Red"]"[/color]Documents and Settings[color="Red"]"[/color]
```


----------



## ale (Apr 13, 2009)

SeanC said:
			
		

> Not my area of expertise, but this looks odd. Shouldn't the quotes come after the forward-slash?
> 
> 
> ```
> ...



From what I can remember, on cygwin it should be something like _"/cygdrive/c/Documents and Settings"_.
The dos unit _C:_ should be _/cygdrive/c_


----------



## SeanC (Apr 14, 2009)

That's what I was thinking. The whitespace probably needs to be handled correctly.


----------

