bad PATH conversion under XP

Rafael Kitover rkitover@cpan.org
Wed Jan 26 05:08:00 GMT 2011


On 1/25/2011 7:14 PM, Cyrille Lefevre wrote:
>
> Hi,
>
> v2$ uname -a
> CYGWIN_NT-5.1 PC213736 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin
>
> aka
>
> Windows XP Professional Ver 5.1 Build 2600 Service Pack 3
>
> though SSH at least :
>
> v2$ regtool get /machine/SYSTEM/CurrentControlSet/Control/Session\
> Manager/Environment/PATH
> %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\orawin\BIN;C:\Program
> Files\ATI Technologies\ATI Control Panel;"C:\Program
> Files\Hummingbird\Connectivity\7.00\Accessories\";C:\Program
> Files\QuickTime\QTSystem\;D:\sfu\Perl\bin\;D:\sfu\common\;C:\WINDOWS\system32\WindowsPowerShell\v1.0\;C:\Program
> Files\Samsung\Samsung PC Studio 3\
>
> gives :
>
> /usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/orawin/BIN:/cygdrive/c/Program
> Files/ATI Technologies/ATI Control Panel:"C:/Program
> Files/Hummingbird/Connectivity/7.00/Accessories/":/cygdrive/c/Program
> Files/QuickTime/QTSystem/:/cygdrive/d/sfu/Perl/bin/:/cygdrive/d/sfu/common/:/cygdrive/c/WINDOWS/system32/WindowsPowerShell/v1.0/:/cygdrive/c/Program
> Files/Samsung/Samsung PC Studio 3/:/bin
>
> note the unconverted path between double-quotes :
>
> "C:/Program Files/Hummingbird/Connectivity/7.00/Accessories/"

I saw this problem on msys, I think it applies to cygwin as well.

If you just go into environment under advanced system settings in 
control panel and remove the double quotes, it will work correctly. I'm 
on Windows 7.

>
> also, how about to get rid of final slashes (.../ => ...) ?

You could reprocess your PATH in your .bashrc, but the final slashes 
should have no effect on how the PATH is actually used...

I cobbled together this awk script, I don't actually know awk :)

export PATH=$(awk 
'BEGIN{RS="[:\n]"}{if(NR>1){printf(":")}sub(/\/$/,"",$0);printf("%s",$0)}' 
<<<$PATH)

>
> this appear to work well under Windows Vista (i.e. : /cygdrive/c/Program
> Files/Hummingbird/Connectivity/7.00/Accessories)
>
> Regards,
>
> Cyrille Lefevre

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



More information about the Cygwin mailing list