[ANNOUNCEMENT] Updated: Cygwin 2.2.0-1

Nicholas Clark nicholas.clark@gmail.com
Thu Aug 6 00:35:00 GMT 2015


You're certainly right that there are nicer ways to write that script.
My point with the sample script above is that I'm currently using a
Windows-style HOME path, and it works fine.

Chances are there are a bunch of other users out there who also use a
Windows-style HOME path in messy .bat files - I just wanted to
illuminate that making Windows paths illegal is likely to break a
whole bunch of users' scripts, and really offers no benefit.



On Wed, Aug 5, 2015 at 5:14 PM, Andrey Repin <anrdaemon@yandex.ru> wrote:
> Greetings, Nicholas Clark!
>
>> I totally agree that setting HOME to a relative-path is probably a Bad
>> Idea, and can/should be undefined behavior. As for absolute paths (and
>> whether they should be POSIX, Windows, or either), that's a little
>> less cut and dry for me.
>
>> I currently use a ton of scripts of the general form:
>
>> --------
>> Cygwin.bat:
>>    @echo off
>
>>    @pushd %~dp0
>>    @set TOP=%CD%
>>    @popd
>
> This wraps into
>
> SET TOP=%~dp0
>
> (If at all necessary to wrap it like that.)
>
>>    set PATH=C:\Windows\SYSTEM32;C:\Windows
>
> SET PATH=%~dp0installation\usr\sbin;%~dp0installation\bin;%SystemRoot%\System32;%SystemRoot%
>
>>    @set HOME=%TOP%\home\%username%
>>    @chdir %TOP%\installation\bin
>
> That's just plain wrong and should not be done to begin with.
>
>>    @start mintty.exe -e %TOP%\installation\bin\bash.exe --login -i
>
> START /B mintty.exe -
>
>>    exit
>
> Don't call "EXIT" unless you have no other choice.
>
>> for using Cygwin in a user-level installation to my local directory.
>
> Cygwin don't care, what level you are using it from, as long as the
> environment is set up correctly.
>
>> It's not a big deal to go through these and update them if Cygwin
>> loses its ability to interpret Windows-style HOME paths, but there are
>> probably a lot of users out there who aren't on the mailing list and
>> wouldn't know that this change was happening until their installations
>> broke.
>
>> So I'm in camp 'leave it as-is', maybe with the exception of
>> disallowing relative paths. :)
>
> I don't know how to say it politely, so I would be blunt: Your setup is wrong.
> There's at least two ways to do it right, but none of them is coming close to
> what you have right now.
> Cygwin offers ability to make all you want pretty straight without any
> tantric scripts.
>
>
> --
> With best regards,
> Andrey Repin
> Thursday, August 6, 2015 03:07:01
>
> Sorry for my terrible english...
>

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