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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; q=dns; s=default; b=QVFf8x7 6ihrD+Q8KOp81U2jzItm2QJMDcxwyao5ecjiAFa7kkCGufKdtmmHTeMI47A2P/O+ aazhclDtOVUCJzGd1iAHg64BUoq0foPH/o+Xy4q7hHAECHyN+7RW6KRfoRHeqc6x pctvk3lWqZr1v4wqtjJ/5ix+Bb7DBLz7PsjU= 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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; s=default; bh=cSfcI0teLP6dP qneN7x3Pui28no=; b=FU7eON9I7lT6uTrNIeXKl+g9aqpqwBlSyZCC+MsS0XkDW XZi8fyRvIEr75QXmEo3NT21imFr3vTh1yyOPNOA1OzQqXT9o2ICuz2byp7DvBaVv ynhDc497kiaObUV8RikVq9BfMcUKywKVNJqSdJKYHJv8JUAgkQtMkc59zBw79I= 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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Soderquist!, soderquist!, bat, Hx-languages-length:1938 X-HELO: mail-wm0-f46.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=4bXpkqDrl9agfhNw3Zo+dxx1CYa4ZjIWZ0DZ2J4gMAE=; b=KWO4jr+aEVyDPQiH4PziiCGqc9emgEy/aP6hOUBmDDpZbDkQ80gtjJxha1kiqlZQTs EUnbBJupq721bSA6zI+PGAdFY7nog2QFtUdvaYIYJDRfuQacRgHuIayse8IDzGXJcoUR yUD3Z2RS8oKJNb9BOae7fV4GYiwAqBK8NWv9LMN25MYQaTO2h7D4e63UyKIliGk+8o7k CmD5Vc/nHGN0MGEVxzfvSUjLLLOPUJL+m+Q00VkIoqkqRtz2W6G5AgtL3m3pEKw7bU3y CQCkIwfJT8NY1QUZREhmy9EeOePYOwjLs/vsV3eMqH0fBtZPthDUOgMycoGlaaydRHpB 5rqQ== X-Gm-Message-State: AEkoouvTodGDRjHT28ROWFAtCNO0iPMAn5Hh2uz93svYbKmvriF/QtzIPue3Ss7huZ1qhgCh27UOfUgHsaBYwA== X-Received: by 10.46.0.92 with SMTP id 89mr782618lja.37.1470843552688; Wed, 10 Aug 2016 08:39:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <310497164.20160810040104@yandex.ru> References: <001001d1edf1$a4e1ae90$eea50bb0$@rogers.com> <1C0AE95E-0118-4353-AA77-4D41F1AE9AE1 AT solidrocksystems DOT com> <001a01d1eea9$f7949a90$e6bdcfb0$@rogers.com> <76ec05e9-140a-19cb-942b-698582c3d024 AT gmail DOT com> <001f01d1ef2c$f04af9e0$d0e0eda0$@rogers.com> <20160805152951 DOT GO25811 AT calimero DOT vinschen DOT de> <57A6ED1C DOT 1060402 AT gmx DOT de> <20160808112321 DOT GF32150 AT calimero DOT vinschen DOT de> <20160808143321 DOT GS25811 AT calimero DOT vinschen DOT de> <8dc84987-802d-30d3-3ebb-2ba25871b561 AT gmail DOT com> <310497164 DOT 20160810040104 AT yandex DOT ru> From: Erik Soderquist Date: Wed, 10 Aug 2016 11:39:08 -0400 Message-ID: Subject: Re: PATHEXT is fundamental to Windows and Should be recognised by CYGWIN To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes On Tue, Aug 9, 2016 at 9:01 PM, Andrey Repin wrote: > Greetings, Erik Soderquist! > >> PATHEXT looks for *executable* files, not file association. I warned >> previously in this thread about getting the two confused. > > Your statement is confusing. If not contradictory. > PATHEXT tells the shell to consider these file extensions executable. > If you create a file association for ".sh" and add ".SH" to pathext, CMD will > happily execute it, and in the current console. PATHEXT is very simply a list of extensions CMD.EXE will automatically append to the given filename when searching the PATH for a command to execute. Once a filename+extension is found, CMD.EXE still needs to know what to do with the given file to be able to execute it. In the case of .bat and .cmd files, CMD.EXE knows these are lists of commands to be executed in order. In the case of .exe files, CMD.EXE knows that these files are executable unto themselves. When CMD.EXE finds a file with an extension in the PATHEXT list to match the extension-less request, it considers the search for the requested command complete, and at this point PATHEXT has served its purpose. CMD.EXE then looks to the execution of the command, and this is where File Associations come in when the extension is not already natively known to CMD.EXE, and are a partial equivalent to *nix's #! line in script files. For example, .VBS is considered executeable, but CMD.EXE has to look up under File Associations *how* to execute it. (I do not remember exactly how, but to prove a point years ago, I modified my registry so that .txt was considered 'executable' in the same way .VBS is, and the execute method was "edit.com %*" (I think). This had very annoying results since I also put .txt as the first extension for PATHEXT, and so foo.txt was opened in edit.com rather than foo.bat being run). -- Erik -- 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