LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-10-2008, 10:53 AM   #1
BeacoN
Member
 
Registered: Nov 2008
Distribution: Linux Mint
Posts: 56

Rep: Reputation: 17
bash: unexpected end of file --fix


hey guys....this is just sharing what I've found. I pulled my hair out trying to figure out what was causing this error. One reason is a comment that is right after a block (most times this is the case for me). similar to my java programming I do it to clarify the matching } like...
function myFunk {
... code ...
}#end myFunk
well this works fine for the java compiler, but Bash throws a temper tantrum like a 5 year old brat in the walmart candy aisle. so, all you have to do is add some good ol' whitespace...
function myFunk {
... code ...
} #end myFunk
and the brat gets his candy :-)
 
Old 11-10-2008, 12:31 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
I think this is because of the other meanings of the hash symbol in bash, as in parameter substitution and for specifying the base of a numerical constant. The problem arises every time you have an inline comment not preceded by a blank space, not only at the end of a function definition.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'unexpected end of file' error saru06 Programming 2 08-09-2007 02:02 AM
X11R72: configure fails due to unexpected end of file? ichrispa Linux - Software 0 07-28-2007 08:00 AM
bash "unexpected end of file" script error Runge_Kutta Linux - General 6 05-23-2007 04:36 PM
Unexpected end of file??? raid517 Linux - Software 2 12-01-2004 05:10 AM
ACPI: Unexpected end of file h1tman Slackware 6 09-08-2003 05:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration