Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
To: cygwin@cygwin.com
From: Andrew DeFaria <Andrew@DeFaria.com>
Subject: Re: Running Windows scripts & PATHEXT
Date: Mon, 30 Aug 2004 16:29:37 -0700
Lines: 37
Message-ID: <ch0d5m$g82$1@sea.gmane.org>
References: <cgvhro$5uj$1@sea.gmane.org> <Pine.GSO.4.61.0408301152070.24572@slinky.cs.nyu.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@sea.gmane.org
X-Gmane-NNTP-Posting-Host: 12.9.207.207
User-Agent: Mozilla Thunderbird 0.7+ (Windows/20040827)
In-Reply-To: <Pine.GSO.4.61.0408301152070.24572@slinky.cs.nyu.edu>
X-IsSubscribed: yes

Igor Pechtchanski wrote:

> Ugh. I fully agree with CGF - the "hide the extension" business is 
> ugly, counterproductive, and should not be used.

Well Cygwin's already doing it WRT things like .exe and .lnk... :-)

> Having said that, is there any reason why
>
> $ ln -s myscript.pl myscript && chmod a+x myscript.pl
>
> doesn't do the trick? AFAIK, Windows doesn't attempt to execute files 
> with no extension, so it won't interfere with CMD, and will allow bash 
> to execute myscript.pl by typing "myscript"...

Nah it'd work. Just that I'd have to create additional links for every 
myscript I come up with! That's what I was trying to avoid.

> The situation with VB scripts is harder. I'd go for something like
>
> $ cat > myscript << EOF && chmod a+x myscript
> #!/bin/bash
> cscript /nologo myscript.vbs
> EOF
>
> if you wanted to run "myscript.vbs" by just typing "myscript". FWIW, 
> if there were a way to get Visual Basic to ignore the shebang line at 
> the top, there's a way of specifying the right script interpreter, 
> too, so that you could run "myscript.vbs" directly, but I guess VB 
> will punt on that, so I won't go into details.

Well one thing that I did was create a .cmd file that runs the .vbs with 
cscript instead of wscript but again, having to create and maintain an 
additional file (myscript.cmd calls myscript.vbs with cscript) *plus* 
have to make a symlink for myscript -> myscript.cmd (would that even 
work?!? - your example was a symlink -> a .pl file not a .cmd that calls 
a .vbs, etc....) is just getting way to messy...


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

