delorie.com/archives/browse.cgi | search |
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:message-id:date:from:mime-version:to:subject | |
:references:in-reply-to:content-type:content-transfer-encoding; | |
q=dns; s=default; b=UaNEePAZfyvP6DyKWFhwsJaSTsdDO/s+v8uBJIr44DV | |
ZmY1RogFZoTMsSTvITDBamPjkhRFMQEM/Jj0LxN5PlA4RG1FYelOEOAVN8XW/lYs | |
dfze/gLc1pjiuXZahs2oZb7W5tZWWw1nVe6ZeI+5pDTTJhxG8azsLNgaBBhYIZL0 | |
= | |
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:message-id:date:from:mime-version:to:subject | |
:references:in-reply-to:content-type:content-transfer-encoding; | |
s=default; bh=QG2FyLYCHiFKNdAi+6vpSZEmlIQ=; b=lUlMNrwxW7X97i/a9 | |
EZIrjyUWCZZKGgE4wUan/eLyNNOQmwHyCnL+3ejXA2PjTLjbq5NUU2QTiJMG7Rli | |
xmRZCIHgsfVA2bZ74h3kKFnle1V7qg8/xSMlmZ97LbLqJW1oKEJ9JECruAE8E3j3 | |
VZeNAGsqgYzEs24ScBCsfX4gFA= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
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=-0.3 required=5.0 tests=AWL,BAYES_40,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 |
X-HELO: | Ishtar.tlinx.org |
Message-ID: | <532A5388.6020508@tlinx.org> |
Date: | Wed, 19 Mar 2014 19:33:44 -0700 |
From: | Linda Walsh <cygwin AT tlinx DOT org> |
User-Agent: | Thunderbird |
MIME-Version: | 1.0 |
To: | Peter Holsberg <pjh42 AT pobox DOT com>, "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com> |
Subject: | Re: Executing a perl script from Windows 7 |
References: | <531CAE25 DOT 2060705 AT pobox DOT com> |
In-Reply-To: | <531CAE25.2060705@pobox.com> |
X-IsSubscribed: | yes |
Peter Holsberg wrote: > Hi, > > I have a perl script that I would like to execute simply by > double-clicking on its name from a Windows filemanager window. > I tried using this: > #!C:\cygwin64\bin\perl.exe > > as the first line in the script but when I double-click the script, > Windows opens it in a text editor. (I suppose I have .pl associated with > that editor!) ---- Sorry for late reply, you probably already have this solved. But if you wanted to do it through Explorer... A simple way... but it won't open in your text editor anymore, Open Explorer and goto a directory with a .pl extension in it. hover over it so it is selected (but you don't want to open it). (I say "over", as I have "single-click to open", like links, and hover selects). then at the top of the Explorer window below the optional address and command bars, you should see a line that has things like: Organize Open â–¼ Print E-mail Burn New folder Click on the triangle by open it should give you a choice menu. Goto Choose default program... (bottom line). For you, it looks like you have cygwin in cygwin64, so in there you can *Browse*, for perl.exe, or just type in its path (on your system looks like it should be): C:\cygwin64\bin\perl.exe If you always want to open .pl files with perl, check the box to "always open this type of file with this program. then .. OK. If your program doesn't call any other programs, you are done. If it does -- you need to make sure your cygwin paths, especially "C:\cygwin64\bin" are in your PATH var in Windows, at least your User ENV vars... (Control Panel -> System -> System Properties, Advanced tab, @ bottom under Environment vars); Best to try it under user vars first (if you really mess up, you can signing as another user and correct it, but if you mess up the system path, your system may not even boot correctly, if at all). Either append or prepend your cygwin64 bin path to it and use ";" (semi-colon) as a separator (no spaces). Personal hint - When I have lots of stuff in a path, I find it easier to go into the edit box, use Control-A (select all), and ontrol-C to copy the text and open a text editor (gvim). There I use the command (: is the colon prompt in vi) :s/;/^M/g to get ^M -- press control-V, control-M... That will put each path on a separate line. When I'm done, I do the opposite: (% means 'all lines') :%s/\n/;/ Sometimes you need to delete an extra ';' off the end...after you do the above because vim will often insert an extra 'end of line' at the end of the file. I.e. the end of the path should probably not end with a ';', but it probably won't hurt if it is there (I'd have to test to see). --- Except for the PATH part, the "opening" part is done in explorer... Once you have cygwin in your PATH, you can add other programs the same way like mapping ".sh" -> C:\cygwin64\bin\bash.exe" .sh -> C:\cygwin64\bin\bash for example. -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |