LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with the bash_profile [ unexpected end of the file ] (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-the-bash_profile-%5B-unexpected-end-of-the-file-%5D-881459/)

shivamkalra 05-18-2011 12:36 PM

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

TB0ne 05-18-2011 01:01 PM

Quote:

Originally Posted by shivamkalra (Post 4360108)
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.

TobiSGD 05-18-2011 01:19 PM

This file only has 45 lines.

catkin 05-18-2011 02:14 PM

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.


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