X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=FAxHuqTQi/XHYNgv fsHV5SLA5PjyFTInEXvbF1M25MbpdjFUJvudUhT9Z6xGae4ADHMMDLP1wwVK+PYi H4fl5tUk7Fmo1kPikuN8oxZzznL9hdF7tLGQCblUPAKmiMI+BQsWJ9zCReUhk/aE rNee4GIQxbNFnolSAFaBnXpLzQk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=LSgHZDd/Ste8gApJCfONS+ QIdoE=; b=MGGeqVPYNk3zdbh+M2BCVWOAiTjkLYqjqWQijh0iF8A2yrV6lB0Ses yXv9Dl8Pr89aOI3NScXs8jZv5OI/UkaEniKf/ENgjK0DchuBHJ/st4X49rF0tiXI rIlhYa8mokz9AIwam3TSG6DJop3EOUbfGSSID+b/Oo7wlzRYHmRg8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_40,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=Bengt, occasion, H*f:sk:57C1788, Hx-languages-length:1200 X-HELO: mout.kundenserver.de Subject: Re: Proposal for new cygwin.bat which is independent from install directory To: cygwin AT cygwin DOT com References: <57C06CFA DOT 4060405 AT t-online DOT de> <1974732522 DOT 20160826193931 AT yandex DOT ru> <57C1788B DOT 2010705 AT t-online DOT de> From: Thomas Wolff Message-ID: <57C191DC.4040407@towo.net> Date: Sat, 27 Aug 2016 15:13:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <57C1788B.2010705@t-online.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1;V01:K0:bZZuKB5cdjA=:xNUMAbCiH1KMD9b5YoO3WL tTKykMSsBHF+lBnvgW5m3+NNEk0KMusqKDgWcXFpHymJNkL4LR9K1fewYGtqN8+mtp7naF5Sy caaCy8k4AWYHo+aJQzrP6kpWYqssYCck0/0o5D4UGFPZexID07dQpaeEGqSPJt5kajeu6hreT UBy71Jgig3GKuME668Xkuo/C0T87SyR7T1mPiu90fwpuh9MtjsVZ/1UrZ0PDW2J5OD5HcPgYh 4tZjd/lu5iYpxQCaf4DXcphIqm4s5XeBNp6IKVJgYO5Wx1rpb9lfRYZnB1787knUoxkFSSj8n 3ActTOoah0p0x9hOPJKlEZJWWLqzcVvgjUC0TkjXxT7GgBTjvoFrExQHqlzaYrnGZCVyfcF1u 77iwrJ7hk84d4sGw3tyXwMmF491Nxa0HjDhlfJzc/ael2B7R1p9Q/ARgrhTOOgM6KPfkoNptD YiJ10kW4KAm4KnXBHnj7qp6oUtOh4dbL3snfFUq5dtsoyfQvgks5LiRESktASv139Y4RUHicN 78/vOrDvqwAomNKtstnFy+qXQbDgLyCqIA0Ls+6gufC5lVJIEdqi9NUFD4eHcgliWZ2mD1hNZ iwby58AIgDVERSMQBA5SD8WfMx70xZ0XU4mYydvFbGXXfhCVo1e5dmE25ObTGrMBRomRYfF9p 5YAdw3ea/xy7epaPZ8zIGxXhvDLK00vrjI99uyl5jctLQMfQ5eNZulwMcnlajnqtVuLaxI+Ne wpbqF6QeMn5S/gUk X-IsSubscribed: yes Am 27.08.2016 um 13:24 schrieb Christian Franke: > Bengt Larsson wrote: >> Andrey Repin wrote: >>>> The following should work since WinXP regardless of install directory: >>>> ----- >>>> @echo off >>>> >>>> cd /d %~dp0 >>>> if errorlevel 1 exit /b 1 >>>> cd bin >>>> if errorlevel 1 exit /b 1 >>>> >>>> bash --login -i >>>> ----- >>> Why so complicated? >> Also don't see why so complicated. While staying in the console, how >> about: >> ----- >> @echo off >> >> cd /d "%~dp0\bin" >> >> bash --login -i >> ----- > > An errorlevel check is IMO mandatory after a cd command. Otherwise > another bash in the PATH might be started if the directory does not > exist. > Hmm... therefore it is also better to change the last line to: > > .\bash --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). If someone submits a patch to change cygwin.bat, please also add a command to clear $TERM on that occasion, in order to avoid trouble if cygwin.bat is started from a terminal: set TERM= Thomas -- 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