LinuxQuestions.org
Register a domain and help support LQ
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 05-18-2011, 01:36 PM   #1
shivamkalra
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: Disabled
Problem with the bash_profile [ unexpected end of the file ]


Hello everyone, I'm new to Linux. I'm trying to edit the bash_profile but I'm getting this error.

"/.bash_profile: line 46: syntax error: unexpected end of the file"

Here is my bash_profile. Any help would be appreciated.


# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# Get the InfoSphere Stream Support
if [ -f /opt/ibm/InfoSphereStreams/bin/streamsprofile.sh ]; then
source /opt/ibm/InfoSphereStreams/bin/streamsprofile.sh
fi

# The following three lines have been added by UDB DB2.
if [ -f /home/db2inst1/sqllib/db2profile ]; then
. /home/db2inst1/sqllib/db2profile
fi

# export STREAMS_ADAPTERS_ODBC_DB2=true
export STREAMS_ADAPTERS_ODBC_INCPATH=/home/db2inst1/sqllib/include
export STREAMS_ADAPTERS_ODBC_LIBPATH=/home/db2inst1/sqllib/lib64
export STREAMS_ADAPTERS_ODBC_DB2=$STREAMS_ADAPTERS_ODBC_INCPATH:$STREAMS_ADAPTERS_ODBC_LIBPATH

# Add Collabnet SVN
PATH=/opt/CollabNet_Subversion/bin/:$PATH

# Java environment variables
export JAVA_HOME=/opt/ibm/java-x86_64-60
export JDK_HOME=$JAVA_HOME
export JAVA_ROOT=$JAVA_HOME
export JRE_HOME=$JAVA_HOME/jre
export JAVA_BINDIR=$JAVA_HOME/bin
PATH=$JAVA_BINDIR:$PATH

# Apache Ant Environment variables
export ANT_HOME=/usr/local/ant
PATH=$PATH:$ANT_HOME/bin

# eclipse specific variables
PATH=$HOME/eclipse:$PATH
# User specific environment and startup programs

PATH=$PATH:/usr/sbin/:$HOME/bin

export PATH
unset USERNAME
 
Old 05-18-2011, 02:01 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,314

Rep: Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877
Quote:
Originally Posted by shivamkalra View Post
Hello everyone, I'm new to Linux. I'm trying to edit the bash_profile but I'm getting this error.

"/.bash_profile: line 46: syntax error: unexpected end of the file"

Here is my bash_profile. Any help would be appreciated.
Code:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# Get the InfoSphere Stream Support
if [ -f /opt/ibm/InfoSphereStreams/bin/streamsprofile.sh ]; then
        source /opt/ibm/InfoSphereStreams/bin/streamsprofile.sh
fi

# The following three lines have been added by UDB DB2.
if [ -f /home/db2inst1/sqllib/db2profile ]; then
    . /home/db2inst1/sqllib/db2profile
fi

# export STREAMS_ADAPTERS_ODBC_DB2=true
export STREAMS_ADAPTERS_ODBC_INCPATH=/home/db2inst1/sqllib/include
export STREAMS_ADAPTERS_ODBC_LIBPATH=/home/db2inst1/sqllib/lib64
export STREAMS_ADAPTERS_ODBC_DB2=$STREAMS_ADAPTERS_ODBC_INCPATH:$STREAMS_ADAPTERS_ODBC_LIBPATH

# Add Collabnet SVN
PATH=/opt/CollabNet_Subversion/bin/:$PATH

# Java environment variables
export JAVA_HOME=/opt/ibm/java-x86_64-60
export JDK_HOME=$JAVA_HOME
export JAVA_ROOT=$JAVA_HOME
export JRE_HOME=$JAVA_HOME/jre
export JAVA_BINDIR=$JAVA_HOME/bin
PATH=$JAVA_BINDIR:$PATH

# Apache Ant Environment variables
export ANT_HOME=/usr/local/ant
PATH=$PATH:$ANT_HOME/bin

# eclipse specific variables
PATH=$HOME/eclipse:$PATH
# User specific environment and startup programs

PATH=$PATH:/usr/sbin/:$HOME/bin

export PATH
unset USERNAME
Ok...try deleting line 46 and see what happens. If there are characters on that line, insert a line ABOVE the existing line 46, and RETYPE THAT LINE MANUALLY, then delete the original. Might have some garbage on that line from a different editor or some corruption.
 
Old 05-18-2011, 02:19 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
This file only has 45 lines.
 
Old 05-18-2011, 03:14 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
TB0ne is likely right that there is some garbage in the file. I copied it from the post and sourced it: no problems. If you edit it vi, you might see some characters preceded by a ^

Alternatively you could do similar to what I did -- rename the original and re-create by copying from your own post and pasting into a new version of the file.
 
1 members found this post helpful.
  


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 valerio orfano Linux - Newbie 4 12-29-2010 07:16 AM
[bash] unexpected end of file waqasdaar Programming 6 04-03-2009 10:31 AM
'unexpected end of file' error saru06 Programming 2 08-09-2007 02:02 AM
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


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