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 06-24-2010, 09:23 AM   #1
freephys
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
why i get syntax error: unexpected end of file ??


I kept getting " syntax error: unexpected end of file" for the last line. it is a empty line. even if i delete that empty line, it complains for the last non-empty line. what is wrong?

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions
PYTHONPATH=/home/mine/Softwares/p25/

source /etc/profile
#history related
export HISTIGNORE="[ \t]*:&:history:exit"
alias ll='ls -l --color=tty'
alias l.='ls -d .* --color=tty'
alias f='find . -name'
alias fi='find . -iname'
alias xtop='xterm -e top &'

#function gfn(){
#find . -name $2 -print0 | xargs -0 -e
#grep -n -e $1
#}
#
#function xtail(){
#xterm -e "tail -f $1" &
#}

 
Old 06-24-2010, 09:36 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,811
Blog Entries: 1

Rep: Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191Reputation: 1191
Hi and welcome to LQ.

I think you're asking too much of us. My eyesight is still quite good, but I can't see a thing of your code. Can you use a normal font colour and wrap it in the [code] tags, please?


edit: I think it's the browser I'm using. Anyway, I'd be better to use the code tags. That's what they are for.

Last edited by sycamorex; 06-24-2010 at 09:42 AM.
 
Old 06-24-2010, 09:49 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
As sycamorex said, please don't use color tags to print the code. It's almost impossible to read that color. Please put [code][/code] tags around it instead.

"Unexpected end of file" usually means that you forgot to put the proper closing on a command string. That is, you're missing a closing quote-mark, bracket, or loop ender like "done", "esac", or "fi". The shell keeps looking until it finds an appropriate closing mark, or it reaches the end of the file. In quotes especially, there's sometimes a cascading effect, as it steps from quote to quote off-and-on until the last one mismatches.

I don't see anything in the above like that, and it imports just fine for me. But since it does source /etc/bashrc and /etc/profile, you'll need to look there as well.


As an aside, I see the HISTIGNORE variable has the "[ \t]*:&:" trick to ignore duplicates and entries starting with spaces. But you can now set a separate HISTCONTROL variable to control that behavior. It even allows a new value, "erasedups", to remove the previous history entries, so that the commands you enter stay near the top of the stack. Check it out in the bash man page.
 
Old 06-24-2010, 10:03 AM   #4
Bratmon
Member
 
Registered: Jul 2009
Location: 75.126.162.205:80
Distribution: Arch / Mint 17
Posts: 297
Blog Entries: 3

Rep: Reputation: 50
Quote:
Originally Posted by sycamorex View Post

edit: I think it's the browser I'm using.
No I'm almost positive it's the [color="wheat"] tags
this is a test.
 
  


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
-bash: *.sh: line 25: syntax error: unexpected end of file prashanth212 Linux - General 8 04-06-2010 12:52 AM
bash line 74: syntax error: unexpected end of file help? andycol Linux - General 5 09-14-2009 09:12 AM
syntax error: unexpected end of file ygdrazil Linux - Newbie 3 07-23-2009 06:00 AM
Bash script -----------syntax error: unexpected end of file ArthurHuang Programming 2 05-01-2009 11:29 AM


All times are GMT -5. The time now is 10:39 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