public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* BASH :: commenting-out of dirs in aliases
@ 2000-02-15 15:12 Sean Champ
  2000-02-15 15:42 ` Bob McGowan
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Champ @ 2000-02-15 15:12 UTC (permalink / raw)
  To: cygwin

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
  configit
so that it would open up
   /home/.profile
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
following:

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,
anyway.



...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 cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BASH :: commenting-out of dirs in aliases
  2000-02-15 15:12 BASH :: commenting-out of dirs in aliases Sean Champ
@ 2000-02-15 15:42 ` Bob McGowan
  0 siblings, 0 replies; 2+ messages in thread
From: Bob McGowan @ 2000-02-15 15:42 UTC (permalink / raw)
  To: Sean Champ; +Cc: cygwin

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:

  alias configit

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
backslashes.

Cheers,

Bob

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
>   configit
> so that it would open up
>    /home/.profile
> 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
> following:
> 
> 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,
> anyway.
> 
> ...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 cygwin-unsubscribe@sourceware.cygnus.com

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-02-15 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-15 15:12 BASH :: commenting-out of dirs in aliases Sean Champ
2000-02-15 15:42 ` Bob McGowan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).