LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-22-2010, 09:16 AM   #16
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135

Ridiculously wild recommendation
Code:
if [ -f /home/xri/personal/somedata.kdb.lock ]; then
rm /home/xri/personal/somedata.kdb.lock;
fi
 
1 members found this post helpful.
Old 12-22-2010, 09:19 AM   #17
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
And check whether typeset -F lists any function names that could be affecting the if-fi code.
 
1 members found this post helpful.
Old 12-22-2010, 09:46 AM   #18
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
Just checked out; the "if" command can be overruled by an alias. In order of execution (correct me if I'm wrong) comes:
- alias
- shell functions
- binaries in order as they appear in the path, unless a direct full pathname is given.

Check if one of your aliases is named "if" :
Code:
alias | grep if
I reckon this would cause unexpected EOFs
 
1 members found this post helpful.
Old 12-22-2010, 11:58 AM   #19
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Aliasing if certainly causes lots of syntax errors but doesn't seem to cause EOF errors, have you tried just moving the files aside and recreating them from scratch?
 
1 members found this post helpful.
Old 12-26-2010, 10:52 AM   #20
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283

Original Poster
Blog Entries: 11

Rep: Reputation: 41
Sorry for the delay to answer to the last posts (this is getting very interesting/educational for me). I've been spending Christmas time with the family, away from my box.
I will use your latest suggestions on my rig today, and I'll post again.
 
Old 12-27-2010, 11:05 PM   #21
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283

Original Poster
Blog Entries: 11

Rep: Reputation: 41
1)
Quote:
unalias -a
After which, source .bashrc keeps producing the same error message.

2)
Quote:
typeset -F
Does not show anything coinciding with the if statements

3)
Quote:
alias | grep if
does not return any hit. HOWEVER...
Quote:
alias | grep fi
produces alias fi='find . -iname', which coincides with the fi part of the last line of the if statement.

I replaced that line and everything returned to normal.

In short, brilliant and timely suggestions led me to a solution of this. They also led me to read some necessary material to better understand the problem. For all this I'm grateful to you guys.
 
1 members found this post helpful.
Old 12-28-2010, 05:43 AM   #22
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Great that you solved it at last but I do not understand why unalias -a did not fix the problem if it was caused by a fi alias -- unless the fi alias was defined by the $PROMPT_COMMAND value ... ?
 
1 members found this post helpful.
Old 12-28-2010, 07:23 PM   #23
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
the .bashrc was likely setting the alias again =)
 
2 members found this post helpful.
Old 12-28-2010, 09:03 PM   #24
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks mRgOBLIN That would explain it -- not directly but via /etc/bashrc according to post #3. .bash_logout would have been OK after unalias -a
 
1 members found this post helpful.
Old 12-29-2010, 06:56 AM   #25
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
:-) great you got it solved! Now: remember to never ever use any shell keyword as an alias :-D Unless you intentionally want to break it's functionality.
Should've thought that one up: indeed "if" would not cause the unexpected EOF, but an if that never gets closed would... hence "fi" was indeed ever the most logical reason.
 
1 members found this post helpful.
Old 01-12-2011, 12:36 PM   #26
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283

Original Poster
Blog Entries: 11

Rep: Reputation: 41
This thread will be among my favorites on my scrapbook. Quite educational
 
  


Reply



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
[SOLVED] syntax error: unexpected end of file adidoosh100 Programming 14 08-08-2010 12:44 AM
why i get syntax error: unexpected end of file ?? freephys Linux - Newbie 3 06-24-2010 09:03 AM
syntax error: unexpected end of file ygdrazil Linux - Newbie 3 07-23-2009 05:00 AM
Bash script -----------syntax error: unexpected end of file ArthurHuang Programming 2 05-01-2009 10:29 AM
Bash script - syntax error: unexpected end of file Mr Pink Programming 7 12-19-2008 06:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:25 PM.

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
Open Source Consulting | Domain Registration