This is the mail archive of the
mailing list for the Cygwin project.
Re: Proposal for new cygwin.bat which is independent from install directory
Greetings, Christian Franke!
>> Also don't see why so complicated. While staying in the console, how
>> @echo off
>> cd /d "%~dp0\bin"
>> bash --login -i
> An errorlevel check is IMO mandatory after a cd command.
--login will change the CWD either way, and if it fail to execute, it will
fail either way.
Do NOT include redundant error handling "just because you can", or to report
to the user.
Only include error handling, if you have a plan to recover from error
condition, otherwise the scripting engine will report the error on its own,
you don't need to do anything special for that.
> another bash in the PATH might be started if the directory does not exist.
That's because you're doing it wrong.
> Hmm... therefore it is also better to change the last line to:
> .\bash --login -i
"%~dp0bin\bash.exe" --login -i
> The directory change is intentionally done with two cd commands to avoid
> possible problems with cmd variants (on Win10 "%~dp0" expands to a path
> with trailing backslash).
It ALWAYS expands into a path with trailing slash.
Read CALL /? and note the combining rules for modifiers.
With best regards,
Saturday, August 27, 2016 19:05:19
Sorry for my terrible english...
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple