delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/30/11:41:57

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: Running Windows scripts & PATHEXT
Date: Mon, 30 Aug 2004 08:41:38 -0700
Lines: 31
Message-ID: <cgvhro$5uj$1@sea.gmane.org>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: h-67-102-25-114.lsanca54.covad.net
User-Agent: Mozilla Thunderbird 0.7+ (Windows/20040827)
X-IsSubscribed: yes

Being in a Windows environment is made a lot more palatable with Cygwin 
- we all know this. But we often face others who don't know, understand 
or want to use/learn Cygwin or who want what we might develop in Cygwin 
available for others who don't have Cygwin.  As such I've been writing 
some Visual Basic (ick! But I'm getting used to it...) and cmd scripts.

Now one problem is that I write a script intending for it to have 
stdin/stderr connected to a terminal. But by default vbs files are 
executed by wscript and calls to WScript.Echo pop up a message box for 
each call. However I can execute cscript to have it run "normally" 
writing to stdout. Now cscript display ugly logo info which can be 
suppressed by using /nologo. So I want an invocation of myscript.vbs to 
run cscript /nologo myscript.vbs. I think I can do that by making the 
appropriate registry entries but I still have to execute at least 
myscript.vbs.

I've also made a Perl script file type and have added .pl to the PATHEXT 
variable so that I can invoke a Perl script such as myscript.pl simply 
by typing myscript (in cmd but not in bash - in bash I need to specify 
myscript.pl).

So it seems that bash does not take into account the PATHEXT variable 
when searching for executables. Now I know that PATHEXT is very 
Window'ish and bash need not support it but perhaps Cygwin's bash does 
somehow and I merely need to configure it correctly? I"m looking to be 
able to simply type myscript and have it run myscript.pl (or 
myscript.cmd or myscript.vbs - I guess I oughta ask: How would it 
determine which one to run in the face of multiple scripts? I guess 
order of the PATHEXT?)
-- 
If you can smile when things go wrong, you have someone in mind to blame.


--
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