The error is most likely occurring before this block of code. For example, if I put this block of code in it's own script and echo the aliases lines out:
#!/bin/bash
# example.bash
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
echo "alias ls='ls --color=auto'"
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
echo "alias grep='grep --color=auto'"
echo "alias fgrep='fgrep --color=auto'"
echo "alias egrep='egrep --color=auto'"
fi
I get this:
$ ./example.bash
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
Which indicates that it's fine.
Terminating case block
This block doesn't have a corresponding esac.
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
....