Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.bashrc syntax error: unexpected end of file

Tags:

linux

bash

I am getting an unexpected end of file error. I am not really sure how to fix it.

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

# User specific aliases and functions

export PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'

export LS_COLORS='di=35;1'


alias la='ls -lah'
alias cdu='cd /home/hzhang/primary'

#module load gnu-compilers/4.7.0
#module load mvapich3/gnu/1.7

.ls /opt/intel/Compiler/11.1/072/bin/ifortvars.sh intel64

#PATH=$PATH:/home/hzhang/primary/over2.2e/bin_dp:/home/hzhang/primary/foiltest
PATH=$PATH:/opt/overflow/intel/serial/bin_dp/:/home/hzhang/primary/chimera2.1/bin_dp/:/u/primary/hzhang/pegasus/bin_dp
export PATH

ulimit -s unlimited 
like image 663
derry30 Avatar asked Aug 13 '12 07:08

derry30


People also ask

What does Unexpected end of file mean in Linux?

An Unexpected end of file error in a Bash script usually occurs when you there is a mismatched structure somewhere in the script. If you forget to close your quotes, or you forget to terminate an if statement, while loop, etc, then you will run into the error when you try to execute your Bash script.

What is the ~/ bashrc file?

The . bashrc file is a script file that's executed when a user logs in. The file itself contains a series of configurations for the terminal session. This includes setting up or enabling: coloring, completion, shell history, command aliases, and more. It is a hidden file and simple ls command won't show the file.


1 Answers

I had the same error due to missing "fi" line. Make sure to omit syntax errors. The original .bashrc is located in /etc/skel/. So just run the following command:

cp /etc/skel/.bashrc ~

like image 125
LSDeva Avatar answered Sep 27 '22 21:09

LSDeva