PDA

View Full Version : .bash_profile and .bashrc



piku
03-06-2006, 03:16 AM
Getting the following error message when I SSH to the system:


: command not found
-bash: /home/user/.bash_profile: line 14: syntax error: unexpected end of file


Am I missing something here. Here's my .bash_profile and .bashrc (system defaults)...

.bash_profile

# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

.bashrc

# .bashrc

# User specific aliases and functions
alias cp='\cp -i'
alias ll='\ls -l'
alias mv='\mv -i'
alias rm='\rm -i'

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

piku
03-07-2006, 11:43 PM
.bash_profile

# .bash_profile

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME

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


.bashrc

# .bashrc

# User specific aliases and functions
alias cls='\clear'
alias cp='\cp -i'
alias ll='\ls -l'
alias mv='\mv -i'
alias rm='\rm -i'

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

PS1='\e[7m`whoami`\e[34;47;7;1m \w \e[0m
> '


last two lines in .bashrc is for a better looking prompt. Let me know if it works on yours. HTH

bonz
03-08-2006, 06:00 AM
piku, mine is just like yours (the default) and works fine.

Is it possible that you edited it and end up with some hidden characters ^M in there, or didn't put a newline at the end that you subsequently fixed with your changes?

piku
03-08-2006, 08:42 AM
piku, mine is just like yours (the default) and works fine.

Is it possible that you edited it and end up with some hidden characters ^M in there, or didn't put a newline at the end that you subsequently fixed with your changes?

Not sure bonz. But whatever it is, the recent changes are the ones I'm sticking too =)