Re: PATH and SystemRoot oddity

2004-12-01 Thread Luke Kendall
On  1 Dec, Igor Pechtchanski wrote:
  The interpolation of the %...% variables into REG_MULTI_SZ values happens 
  on the Windows level, before Cygwin ever sees them.  Windows treats these 
  variables case-insensitively. 
  HTH, 

It does - thanks again, Igor.

luke


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: PATH and SystemRoot oddity

2004-11-30 Thread Luke Kendall
On 26 Nov, Igor Pechtchanski wrote:
  On Fri, 26 Nov 2004, Luke Kendall wrote:
  
  I see that by default PATH includes some entries like
  %SystemRoot%/System32
  
  I also note that $SystemRoot is undefined, yet $SYSTEMROOT contains the
  expected C:\WINDOWS value.
  
  This of course causes problems.  Would a backslash-style path work
  correctly if it were properly interpolated into the PATH?  Is the %
  notation special magic for Cygwin to handle DOS-isms?
  
  The case variance may be of interest, in that case.
  
  The case variance is a red herring.

Could you explain some more?  I was thinking that if SystemRoot but 
SYSTEMROOT was, it might be relevant.

  Also, Cygwin doesn't understand the
  %...% notation.

Sure, of course.

  OTOH, you're not supposed to be seeing these entries in
  the actual value of your PATH, either in Windows or in Cygwin.  Such
  entries are usually caused by the wrong type assigned to the PATH value in
  the registry (REG_SZ instead of REG_EXPAND_SZ).  Some buggy installers
  change the type of the PATH registry entry.

Ah!  So at some point in the machine's history, some buggy installer
altered this, and it has knock-on effects like this.

  You need to change it back,
  so that strings like %SystemRoot% will be automatically expanded by
  Windows before Cygwin ever sees them.
  HTH,
   Igor

I couldn't find an entry for PATH that seemed to be the normal
environment variable - only things buried inside other items like CLSID
that seemed to be used for other things.

In the Control Panel I found that the system environment variable for
PATH was defined to use %SystemRoot%, so I suspect that's where it's
coming from.  And you're right, it's set badly for Windows and Cygwin,
and interfering with all shells:

C:\echo %PATH%
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
C:net use
'net' is not recognized as an internal or external command,
operable program or batch file.

Thanks, Igor

luke


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: PATH and SystemRoot oddity

2004-11-27 Thread Jason Curl
Igor Pechtchanski wrote:
First off, you could have actually removed the offending entries from the
PATH using something like
OFFENDING_ENTRY=/cygdrive/c/ClearCase/bin
PATH=`echo $PATH | sed s#:$OFFENDING_ENTRY##`
Alternatively, if you want to translate any Win32 path to a Cygwin
(POSIX) path, use the cygpath utility, like this:
PATH=${PATH}:`cygpath -u $SYSTEMROOT/system32`
Glad it helped.  Out of curiousity, which one of the two solutions above
did you mean?
Originally, I was looking for something like 'cygpath' in it, but I was 
pleasantly surprised by the other solution:

OFFENDING_ENTRY=/cygdrive/c/ClearCase/bin
PATH=`echo $PATH | sed s#:$OFFENDING_ENTRY##`
I'm now modifying it to remove paths with 'Rational' in it. I'd rather 
not modify the original 'profile' if I can help it. Makes it easier to 
destroy cygwin and reinstall from scratch.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: PATH and SystemRoot oddity

2004-11-27 Thread Igor Pechtchanski
On Sat, 27 Nov 2004, Jason Curl wrote:

 Igor Pechtchanski wrote:
First off, you could have actually removed the offending entries
from the PATH using something like
   
OFFENDING_ENTRY=/cygdrive/c/ClearCase/bin
PATH=`echo $PATH | sed s#:$OFFENDING_ENTRY##`
   
Alternatively, if you want to translate any Win32 path to a Cygwin
(POSIX) path, use the cygpath utility, like this:
   
PATH=${PATH}:`cygpath -u $SYSTEMROOT/system32`
 
  Glad it helped.  Out of curiosity, which one of the two solutions above
  did you mean?

 Originally, I was looking for something like 'cygpath' in it, but I was
 pleasantly surprised by the other solution:

 OFFENDING_ENTRY=/cygdrive/c/ClearCase/bin
 PATH=`echo $PATH | sed s#:$OFFENDING_ENTRY##`

 I'm now modifying it to remove paths with 'Rational' in it.

FWIW, the above 'sed' solution will only work for removing one path (with
no special characters, like '\').  For removing any path with Rational
in it, the regular expression will have to be more elaborate, e.g.,

OFFENDING_KEYWORD=Rational
PATH=`echo $PATH | sed s#:[^:]*$OFFENDING_KEYWORD[^:]*##`

Note that this still won't work properly if OFFENDING_KEYWORD contains
'\'s or '*'s.  If you want proper quoting, you should probably use the
perl regular expressions, in which case it might be easier to simply break
up the PATH at ':'s and reconstruct it after removing all entries with the
offending keyword, e.g.,

OFFENDING_KEYWORD=Rational
PATH=`echo $PATH | perl -pe 
'$_=join(:,grep(!/\Q'$OFFENDING_KEYWORD'\E/,split(/:/)))'`

 I'd rather not modify the original 'profile' if I can help it.  Makes it
 easier to destroy cygwin and reinstall from scratch.

Well, if you're worried about modifying the default /etc/profile, you
might consider putting the above into a /etc/profile.d script, e.g.,
/etc/profile.d/no_rational.sh, which will be executed by the default
/etc/profile.  If you use [t]csh, you might also want to consider cooking
up an equivalent /etc/profile.d/no_rational.csh script.

HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse... -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: PATH and SystemRoot oddity

2004-11-26 Thread Jason Curl
Brian Dessent wrote:
Luke Kendall wrote:

I see that by default PATH includes some entries like
%SystemRoot%/System32
I also note that $SystemRoot is undefined, yet $SYSTEMROOT contains the
expected C:\WINDOWS value.
This of course causes problems.  Would a backslash-style path work
correctly if it were properly interpolated into the PATH?  Is the %
notation special magic for Cygwin to handle DOS-isms?
The case variance may be of interest, in that case.

I think you're falsely attributing your errors to this.  The cygwin DLL
takes care of all the win32 - posix translation of the path, and it
knows about %SystemRoot%.  If this were really the case don't you think
tons of things would break?  Try echo $PATH at your shell prompt and
you'll see that the systemroot is correctly substituted.
FWIW, I think environment variables are case-insensitive at the win32
API level.  They preserve case but are not sensitive to it, just like
ntfs.
Brian
I have a similar question: I had to modify 'profile' to change
  $PATH=:$PATH
to
  $PATH=
How can I simply add $SYSTEMROOT:$SYSTEMROOT/system32 to this? It 
doesn't work as-is because $SYSTEMROOT = C:\Windows (and this is 
therefore not interpreted by the path). Rephrasing, what do I use to 
translate C:\WINDOWS to /cygdrive/c/windows?

I had to do this because some nasty things in my path were causing 
problems (e.g. ClearQuest/ClearCase)

TIA,
Jason.
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: PATH and SystemRoot oddity

2004-11-26 Thread Larry Hall
At 03:14 PM 11/26/2004, you wrote:
Brian Dessent wrote:
Luke Kendall wrote:

I see that by default PATH includes some entries like
%SystemRoot%/System32

I also note that $SystemRoot is undefined, yet $SYSTEMROOT contains the
expected C:\WINDOWS value.

This of course causes problems.  Would a backslash-style path work
correctly if it were properly interpolated into the PATH?  Is the %
notation special magic for Cygwin to handle DOS-isms?

The case variance may be of interest, in that case.

I think you're falsely attributing your errors to this.  The cygwin DLL
takes care of all the win32 - posix translation of the path, and it
knows about %SystemRoot%.  If this were really the case don't you think
tons of things would break?  Try echo $PATH at your shell prompt and
you'll see that the systemroot is correctly substituted.
FWIW, I think environment variables are case-insensitive at the win32
API level.  They preserve case but are not sensitive to it, just like
ntfs.
Brian

I have a similar question: I had to modify 'profile' to change
  $PATH=:$PATH
to
  $PATH=

How can I simply add $SYSTEMROOT:$SYSTEMROOT/system32 to this? It doesn't work 
as-is because $SYSTEMROOT = C:\Windows (and this is therefore not interpreted 
by the path). Rephrasing, what do I use to translate C:\WINDOWS to 
/cygdrive/c/windows?

I had to do this because some nasty things in my path were causing problems 
(e.g. ClearQuest/ClearCase)


I'll state one obvious option - just add /cygdrive/c/windows, etc. in your
'profile'.  If you want Cygwin to do the translation for you, change the path
in 'cygwin.bat' (or whatever your startup link is) instead.



--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: PATH and SystemRoot oddity

2004-11-26 Thread Igor Pechtchanski
On Fri, 26 Nov 2004, Jason Curl wrote:

 I have a similar question: I had to modify 'profile' to change
   $PATH=:$PATH
 to
   $PATH=

 How can I simply add $SYSTEMROOT:$SYSTEMROOT/system32 to this? It
 doesn't work as-is because $SYSTEMROOT = C:\Windows (and this is
 therefore not interpreted by the path). Rephrasing, what do I use to
 translate C:\WINDOWS to /cygdrive/c/windows?

 I had to do this because some nasty things in my path were causing
 problems (e.g. ClearQuest/ClearCase)

First off, you could have actually removed the offending entries from the
PATH using something like

OFFENDING_ENTRY=/cygdrive/c/ClearCase/bin
PATH=`echo $PATH | sed s#:$OFFENDING_ENTRY##`

Alternatively, if you want to translate any Win32 path to a Cygwin (POSIX)
path, use the cygpath utility, like this:

PATH=${PATH}:`cygpath -u $SYSTEMROOT/system32`

HTH,
Igor
P.S. FWIW, the question is not that similar, and you should probably have
started a new thread with it.
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse... -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: PATH and SystemRoot oddity

2004-11-26 Thread Igor Pechtchanski
On Fri, 26 Nov 2004, Luke Kendall wrote:

 I see that by default PATH includes some entries like
 %SystemRoot%/System32

 I also note that $SystemRoot is undefined, yet $SYSTEMROOT contains the
 expected C:\WINDOWS value.

 This of course causes problems.  Would a backslash-style path work
 correctly if it were properly interpolated into the PATH?  Is the %
 notation special magic for Cygwin to handle DOS-isms?

 The case variance may be of interest, in that case.

The case variance is a red herring.  Also, Cygwin doesn't understand the
%...% notation.  OTOH, you're not supposed to be seeing these entries in
the actual value of your PATH, either in Windows or in Cygwin.  Such
entries are usually caused by the wrong type assigned to the PATH value in
the registry (REG_SZ instead of REG_EXPAND_SZ).  Some buggy installers
change the type of the PATH registry entry.  You need to change it back,
so that strings like %SystemRoot% will be automatically expanded by
Windows before Cygwin ever sees them.
HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse... -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: PATH and SystemRoot oddity

2004-11-26 Thread Jason Curl
Igor Pechtchanski wrote:
On Fri, 26 Nov 2004, Jason Curl wrote:

I have a similar question: I had to modify 'profile' to change
 $PATH=:$PATH
to
 $PATH=
How can I simply add $SYSTEMROOT:$SYSTEMROOT/system32 to this? It
doesn't work as-is because $SYSTEMROOT = C:\Windows (and this is
therefore not interpreted by the path). Rephrasing, what do I use to
translate C:\WINDOWS to /cygdrive/c/windows?
I had to do this because some nasty things in my path were causing

First off, you could have actually removed the offending entries from the
PATH using something like
OFFENDING_ENTRY=/cygdrive/c/ClearCase/bin
PATH=`echo $PATH | sed s#:$OFFENDING_ENTRY##`
Alternatively, if you want to translate any Win32 path to a Cygwin (POSIX)
path, use the cygpath utility, like this:
PATH=${PATH}:`cygpath -u $SYSTEMROOT/system32`
HTH,
Igor
P.S. FWIW, the question is not that similar, and you should probably have
started a new thread with it.
Sorry - next time it will be a new thread. OTOH, this is exactly the 
solution I didn't know how to implement. Spasibo Bolshoi!

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: PATH and SystemRoot oddity

2004-11-26 Thread Igor Pechtchanski
On Fri, 26 Nov 2004, Jason Curl wrote:

 Igor Pechtchanski wrote:
  On Fri, 26 Nov 2004, Jason Curl wrote:
 
   I have a similar question: I had to modify 'profile' to change
$PATH=:$PATH
   to
$PATH=
  
   How can I simply add $SYSTEMROOT:$SYSTEMROOT/system32 to this? It
   doesn't work as-is because $SYSTEMROOT = C:\Windows (and this is
   therefore not interpreted by the path). Rephrasing, what do I use to
   translate C:\WINDOWS to /cygdrive/c/windows?
  
   I had to do this because some nasty things in my path were causing
 
  First off, you could have actually removed the offending entries from the
  PATH using something like
 
  OFFENDING_ENTRY=/cygdrive/c/ClearCase/bin
  PATH=`echo $PATH | sed s#:$OFFENDING_ENTRY##`
 
  Alternatively, if you want to translate any Win32 path to a Cygwin
  (POSIX) path, use the cygpath utility, like this:
 
  PATH=${PATH}:`cygpath -u $SYSTEMROOT/system32`
 
  HTH,
  Igor
  P.S. FWIW, the question is not that similar, and you should probably have
  started a new thread with it.

 Sorry - next time it will be a new thread. OTOH, this is exactly the
 solution I didn't know how to implement.

Glad it helped.  Out of curiousity, which one of the two solutions above
did you mean?

 Spasibo Bolshoi!

Na zdorovie.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse... -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



PATH and SystemRoot oddity

2004-11-25 Thread Luke Kendall
I see that by default PATH includes some entries like
%SystemRoot%/System32

I also note that $SystemRoot is undefined, yet $SYSTEMROOT contains the
expected C:\WINDOWS value.

This of course causes problems.  Would a backslash-style path work
correctly if it were properly interpolated into the PATH?  Is the %
notation special magic for Cygwin to handle DOS-isms?

The case variance may be of interest, in that case.

luke


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: PATH and SystemRoot oddity

2004-11-25 Thread Brian Dessent
Luke Kendall wrote:

 I see that by default PATH includes some entries like
 %SystemRoot%/System32
 
 I also note that $SystemRoot is undefined, yet $SYSTEMROOT contains the
 expected C:\WINDOWS value.
 
 This of course causes problems.  Would a backslash-style path work
 correctly if it were properly interpolated into the PATH?  Is the %
 notation special magic for Cygwin to handle DOS-isms?
 
 The case variance may be of interest, in that case.

I think you're falsely attributing your errors to this.  The cygwin DLL
takes care of all the win32 - posix translation of the path, and it
knows about %SystemRoot%.  If this were really the case don't you think
tons of things would break?  Try echo $PATH at your shell prompt and
you'll see that the systemroot is correctly substituted.

FWIW, I think environment variables are case-insensitive at the win32
API level.  They preserve case but are not sensitive to it, just like
ntfs.

Brian

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/