1

I'm trying to get Cygwin setup the tools I use in Windows and am having some troubles. From this post, I found I could specify Notepad++ as my editor using

alias notepad="/cygdrive/c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe"

And this works when I run it through the command line

notepad $( cygpath -pw ~/.bashrc ) &

opens my .bashrc file, however when I try and make this an alias

alias settings="notepad $( cygpath -pw ~/.bashrc ) &"

and type settings I get the get the error

C:\Program Files (x86)\Notepad++\cygwin64homeuser.bashrc doesn't exist. Create it?

I tried defining a variable and had even more issues. What am I doing wrong?

2 Answers 2

2

You are using double quotes in the alias command, so whatever is in the double quotes is executed at the time you are setting the alias. You have to use single quotes around the alias definition, so that variables are resolved when the alias is used. For instance, try these two:

alias wtf1='echo $(pwd)'
alias wtf2="echo $(pwd)"

You will see that wtf1 properly reports the current directory, while wtf2 seems stuck on the directory you were in when you set up the alias.

0

I had a different issue. I updated the $PATH under Cygwin and removed /usr/local/bin by mistake. Only later I noticed that git aliases stopped working. Restoring the PATH resolved it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .