Bash – Why are these aliases failing

aliasbashcygwin;

I am attempting to put some alias definitions in .bashrc. Like this:

#Convienience aliases
alias ll='ls -l'
alias ldir='ls -p | grep "/"'
#Temporary aliases
alias mvFooLog='mv ~/Projects/Foo/Log.txt .'

The last alias will work for me, but there seems to be some subtlety which is corrupting the definition of the first two. When Looking at the output of alias in the console, I get something like the following:

'lias ldir='ls -p | grep "/"
'lias ll='ls -l
alias mvFooLog='mv ~/projects/foo/log.txt .

This is happening in cygwin.

Best Answer

The first two lines strongly suggest that a carriage return (\r) snuck in before the '. Try removing it:

tr -d '\r' <~/.bashrc >~/tmp
mv ~/tmp ~/.bashrc
Related Question