delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/30/19:28:01

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
To: cygwin AT cygwin DOT com
From: Andrew DeFaria <Andrew AT DeFaria DOT 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 AT sea DOT gmane DOT org> <Pine DOT GSO DOT 4 DOT 61 DOT 0408301152070 DOT 24572 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019