Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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
share|improve this answer
    
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
    
That did it! On both counts! Thanks... –  2NinerRomeo Apr 3 '12 at 21:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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