Register
It is currently Sat Nov 22, 2014 8:09 pm

Line 13: Syntax error: Unexpected end of file


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Fri Apr 03, 2009 12:08 pm   

Joined: Fri Apr 03, 2009 12:03 pm
Posts: 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?


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


Top
 Profile  
 PostPosted: Sat Apr 04, 2009 4:40 am   

Joined: Mon Nov 17, 2008 7:25 am
Posts: 221
The unexpected end of file error is printed when a function wants something to end its run with.

In this case it's most likely the here document reference.

Have you tried unquoting << "EOF"?
Might be that Cygwin doesn't interpret "EOF" as EOF

Best regards
Fredrik Eriksson


Top
 Profile  
 PostPosted: Wed Aug 12, 2009 4:51 pm   

Joined: Wed Aug 12, 2009 4:47 pm
Posts: 1
I kept getting this error with one of my scripts in Cygwin. It was because I had the .sh file saved in PC format rather than Linux format and the end of file ASCII characters are different for both...

It wouldn't explain why it works in your Linux box though...


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP