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.


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
  • Please forgive my ignorance, tr is complaining that ~/.bashrc is an "extra operand" any ideas? – 2NinerRomeo Apr 3 '12 at 21:44
  • Sorry, tr doesn't take the input file name, just standard input. I updated to reflect that (just put < to redirect), try it now. – Kevin Apr 3 '12 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.