This is the mail archive of the
mailing list for the Cygwin project.
Re: BASH :: commenting-out of dirs in aliases
- To: Sean Champ <symmetry_web at email dot msn dot com>
- Subject: Re: BASH :: commenting-out of dirs in aliases
- From: Bob McGowan <Robert dot McGowan at veritas dot com>
- Date: Tue, 15 Feb 2000 15:47:17 -0800
- CC: cygwin at sourceware dot cygnus dot com
- Organization: VERITAS Software
- References: <000f01bf780a$4a95ca80$2bbf113f@toolbox>
I don't believe this is a bug. It is the way it works, alas. In
setting the alias in the .profile, the lines are processed two times,
once when the shell defines the alias and then again when the alias is
run. This would also be true if you were to define the alias directly
at the command line. In the second example, the line is processed once.
Look at it this way. The alias command results in an alias that has a
definition that looks like your second line. Then, when you run the
alias, the actual command line argument seen by notepad has single
backslashes in it, just as it does for the command line version.
By the way, there is a command, cygpath, that you can use to convert
paths between the two formats. Type cygpath by itself and you will get
a usage message explaining its use. There is no man page, at least on
my system, which is the CD version 1.0 of Cygwin.
Also, if you use double quotes, you won't have to put all the extra
backslashes in, which can be confusing. You could try the following for
the alias definition:
alias configit="notepad \"$(cygpath -w /home/.profile)\""
You can check the results of the the alias by typing:
which will print out the result of the alias definition. When I did
this (I used the name cfit for short), I got:
$ alias cfit
alias cfit='notepad "c:\Cygwin\home\.profile"'
And the double quotes around the Windows path will protect the enclosed
Sean Champ wrote:
> as salaem 'alekum.
> may the peace of Allah be upon you.
> -- -- --
> I wish I had the ability to fix this myself, currently, and insha' Allah I
> may be able to soon enough ;)
> I was trying to alias the command
> so that it would open up
> for editing
> this is what is required, if it is set as an alias in .profile:
> alias configit="notepad \\\\usr\\\\unix\\\\home\\\\.profile"
> or, I can accomplish the same from the command line by the
> notepad \\usr\\unix\\home\\.profile
> ...with only two \ each ;)
> and perhaps it is really no problem, but I thought it might be worth a note,
> ...also, has the cygwin team tried using bugzilla or sourceforge, to handle
> such notes as this?
> (eg, both have a prioritization system for bug-reports, and this seems to
> be a low-priority thing, here.
> also, either of the two could be a better way than this mailing-list, for
> indexing bugs and solutions/patches/workarounds )
> baraka Allah feek(i).
> may the blessings of Allah be upon you.
> --Sean Champ
> Want to unsubscribe from this list?
> Send a message to email@example.com
Staff Software Quality Engineer
Want to unsubscribe from this list?
Send a message to firstname.lastname@example.org