Line 13: Syntax error: Unexpected end of file

myoung

New Member


Messages: 1

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?

Code:
#!/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
 

MG

Active Member

Reaction score: 17
Messages: 191

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

Code:
#!/bin/bash

(
cat << EOF
#!/bin/sh
echo "test"
EOF
) > filename.txt
for EOF you can use any text.
 

SeanC

Active Member

Reaction score: 7
Messages: 126

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?

Code:
cd [color="Red"]"/Documents and Settings"[/color]
Not my area of expertise, but this looks odd. Shouldn't the quotes come after the forward-slash?

Code:
cd /[color="Red"]"[/color]Documents and Settings[color="Red"]"[/color]
 

ale

Daemon

Reaction score: 166
Messages: 1,059

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

Code:
cd /[color="Red"]"[/color]Documents and Settings[color="Red"]"[/color]
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

Active Member

Reaction score: 7
Messages: 126

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