.Bashrc Syntax Error: Unexpected End of File

.bashrc: syntax error: unexpected end of file

You forgot to close your case at the end of the script with esac. This leaves an unterminated case, causing Bash to reach the end of the file looking for one, triggering this error.

Unexpected end of file ./bash_profile

Your if should have a closing statement which is fi.

Bash profile syntax error: unexpected end of file

I noticed in your .bashrc that there is "alias fi", if-fi are keywords, maybe it creates troubles ... try to comment it in .bashrc. Just a tip.

.bashrc unexpected end of file

You're correct when you say that the troublesome line is the following. You are missing a semicolon. Say:

function find_cpp_filepath_with_string { find $1 -name "*.cpp" -type f
-exec grep -l $2 {} \; ; }

                ^
|----- You need to add a semicolon here!

The first semicolon is required to denote the end of -exec for the find command. The second one is required following the command group.

Syntax Error, Unexpected end of file.

It looks like you didn't close one of if statements:

if [ ! shopt -oq posix]; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
# here add fi <----
fi

bashrc unexpected end of file error/ hadoop

I guess that you didn't set it correctly please follow this:

vi $HOME/.bashrc
put the following lines at the end of the file: (change the hadoop home as yours)

 # Set Hadoop-related environment variables 
export HADOOP_HOME=/usr/local/hadoop

# Set JAVA_HOME (we will also configure JAVA_HOME directly for Hadoop later on)
export JAVA_HOME=/usr/lib/jvm/java-6-sun

# Some convenient aliases and functions for running Hadoop-related commands
unalias fs &> /dev/null
alias fs="hadoop fs"
unalias hls &> /dev/null
alias hls="fs -ls"

# If you have LZO compression enabled in your Hadoop cluster and
# compress job outputs with LZOP (not covered in this tutorial):
# Conveniently inspect an LZOP compressed file from the command
# line; run via:
#
# $ lzohead /hdfs/path/to/lzop/compressed/file.lzo
#
# Requires installed 'lzop' command.
lzohead () {
hadoop fs -cat $1 | lzop -dc | head -1000 | less
}

# Add Hadoop bin/ directory to PATH
export PATH=$PATH:$HADOOP_HOME/bin


Related Topics



Leave a reply



Submit