From cygwin, how do you define an alias to get to windows "My Documents"

0

From the command line, I can get to My Documents by "cd /cygdrive/c/Documents\ and\ Settings/myusername/My\ Documents". The space in the file name must be preceded by a backslash. However when I define an alias (myfiles) in my .bashrc file, source the .bashrc file and then type "cd $myfiles", cygwin says "too many arguments". What am I doing wrong?

Ben Blackwell

Posted 2017-08-20T03:10:51.993

Reputation: 1

Answers

0

Did you try to quote the variable?

cd "$myfiles"

Gribouillis

Posted 2017-08-20T03:10:51.993

Reputation: 164

No, I had not tried using cd "$myfiles" but it works like a champ. Thanks ever so much for the suggestion. – Ben Blackwell – 2017-08-21T19:21:30.230