public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: script-name won't execute but script-name.py will
@ 2001-11-11  8:26 Troy Noble
  0 siblings, 0 replies; 8+ messages in thread
From: Troy Noble @ 2001-11-11  8:26 UTC (permalink / raw)
  To: 'JROZYCKI@ebmail.gdeb.com', cygwin

Try adding

#!/usr/bin/python

as the first line of your scripts (substitute the appropriate
path/filename depending on whether it's python, perl, bash, etc.
and where the filename lives /usr/bin, /usr/local/bin, etc.)
Or if you're sure it's always going to be on your PATH you can use

#!env python

Then the filename extension doesn't matter.

I've even had luck invoking native win32 script interpreters, such as
ActiveState Perl this way such as:

#!/cygdrive/c/Perl/bin/perl

Hey, this stuff really does work like Unix!

Troy

-----Original Message-----
From: JROZYCKI@ebmail.gdeb.com [mailto:JROZYCKI@ebmail.gdeb.com]
Sent: Thursday, November 15, 2001 12:13 PM
To: cygwin@cygwin.com
Subject: script-name won't execute but script-name.py will


-snip ... you're welcome Earnie

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: script-name won't execute but script-name.py will
  2001-11-11  8:26 JROZYCKI
@ 2001-11-11  8:26 ` Pavel Tsekov
  0 siblings, 0 replies; 8+ messages in thread
From: Pavel Tsekov @ 2001-11-11  8:26 UTC (permalink / raw)
  To: JROZYCKI; +Cc: cygwin

Do you have the proper permissions set on your
script files ? Are you running a Win9x or NT ?

JROZYCKI@ebmail.gdeb.com wrote:
> 
> Troy,
> The interpreter line is already specfied on the first line of all my scripts.
> So something else must be the culprit.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* script-name won't execute but script-name.py will
@ 2001-11-11  8:26 JROZYCKI
  0 siblings, 0 replies; 8+ messages in thread
From: JROZYCKI @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin

I'd like to be able to type just my script names (for any language; awk, pl, py,
etc) without having to type the extension as well.

I've tried using the PATHEXT variable but no luck.  I  *could* write aliases for
all my commands but that seems ineficient.

Thanks in advanced.
Jeff



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: script-name won't execute but script-name.py will
@ 2001-11-11  8:26 JROZYCKI
  2001-11-11  8:26 ` David Starks-Browning
  0 siblings, 1 reply; 8+ messages in thread
From: JROZYCKI @ 2001-11-11  8:26 UTC (permalink / raw)
  To: Pavel Tsekov; +Cc: cygwin

Pavel,
We are on NT 4.0.  I believe I have proper permissions because I can run the
script when I tack on the script's extension, such as pl or awk.  The response
is "command not found", not permission denied... Here is some output:

bin $ pwd
/home/jrozycki/bin
bin $ ll
total 51
drwxr-xr-x    5 jrozycki users        4096 Nov 15 19:09 ./
drwxr-xr-x   10 jrozycki users        8192 Nov 15 15:55 ../
-rwxr-xr-x    1 jrozycki users         735 Nov 15 14:41 maxcom.py*
<snip>
bin $ maxcom
bash: maxcom: command not found
bin $ ./maxcom
bash: ./maxcom: No such file or directory
bin $ maxcom.py

Incorrect Syntax - maxcom.py  char INPUTFILE  OUTPUTFILE
bin $ path
/cygdrive/f/bin
/cygdrive/d/Applications
/usr/local/bin
/usr/bin
/bin
/home/jrozycki/bin
<snip>





Pavel Tsekov <ptsekov@syntrex.com> on 11/16/2001 03:49:37 AM

To:   Jeff Rozycki/EB/GDYN@GDYN
cc:   cygwin@cygwin.com
Subject:  Re: script-name won't execute but script-name.py will



Do you have the proper permissions set on your
script files ? Are you running a Win9x or NT ?

JROZYCKI@ebmail.gdeb.com wrote:
>
> Troy,
> The interpreter line is already specfied on the first line of all my scripts.
> So something else must be the culprit.





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: script-name won't execute but script-name.py will
  2001-11-11  8:26 JROZYCKI
@ 2001-11-11  8:26 ` David Starks-Browning
  0 siblings, 0 replies; 8+ messages in thread
From: David Starks-Browning @ 2001-11-11  8:26 UTC (permalink / raw)
  To: JROZYCKI; +Cc: cygwin

On Friday 16 Nov 01, JROZYCKI@ebmail.gdeb.com writes:
> Pavel,
> We are on NT 4.0.  I believe I have proper permissions because I can run the
> script when I tack on the script's extension, such as pl or awk.  The response
> is "command not found", not permission denied... Here is some output:
> 
> bin $ pwd
> /home/jrozycki/bin
> bin $ ll
> total 51
> drwxr-xr-x    5 jrozycki users        4096 Nov 15 19:09 ./
> drwxr-xr-x   10 jrozycki users        8192 Nov 15 15:55 ../
> -rwxr-xr-x    1 jrozycki users         735 Nov 15 14:41 maxcom.py*
> <snip>
> bin $ maxcom
> bash: maxcom: command not found

It sounds like bash cannot locate the interpreter -- the thing in the
line
	#! /path/to/interpreter

But you don't tell us what you have there so it is hard to say
anything more.

The relevant FAQ entry is "Why doesn't my shell script work?".

Regards,
David


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: script-name won't execute but script-name.py will
@ 2001-11-11  8:26 JROZYCKI
  2001-11-11  8:26 ` Pavel Tsekov
  0 siblings, 1 reply; 8+ messages in thread
From: JROZYCKI @ 2001-11-11  8:26 UTC (permalink / raw)
  To: Troy Noble; +Cc: cygwin

Troy,
The interpreter line is already specfied on the first line of all my scripts.
So something else must be the culprit.
Thanks,
Jeff





Troy Noble <troy.noble@channelpoint.com> on 11/15/2001 02:35:01 PM

To:   Jeff Rozycki/EB/GDYN@GDYN, cygwin@cygwin.com
cc:
Subject:  RE: script-name won't execute but script-name.py will



Try adding

#!/usr/bin/python

as the first line of your scripts (substitute the appropriate
path/filename depending on whether it's python, perl, bash, etc.
and where the filename lives /usr/bin, /usr/local/bin, etc.)
Or if you're sure it's always going to be on your PATH you can use

#!env python

Then the filename extension doesn't matter.

I've even had luck invoking native win32 script interpreters, such as
ActiveState Perl this way such as:

#!/cygdrive/c/Perl/bin/perl

Hey, this stuff really does work like Unix!

Troy

-----Original Message-----
From: JROZYCKI@ebmail.gdeb.com [mailto:JROZYCKI@ebmail.gdeb.com]
Sent: Thursday, November 15, 2001 12:13 PM
To: cygwin@cygwin.com
Subject: script-name won't execute but script-name.py will


-snip ... you're welcome Earnie





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: script-name won't execute but script-name.py will
@ 2001-11-11  8:26 JROZYCKI
  0 siblings, 0 replies; 8+ messages in thread
From: JROZYCKI @ 2001-11-11  8:26 UTC (permalink / raw)
  To: John Peacock; +Cc: Pavel Tsekov, cygwin

John,
Thanks for the insight.  I was hoping I *could* add arbitrary extensions.  Like
the .bat and .exe I thought maybe I could setup .py, .pl, .awk extensions to be
automatically recognized.  I'll either have to setup aliases in my .bashrc to
the file or just type the full command_name with extension  (yes my paths are
all set) because when I edit a script in Textpad without an extension I lose
syntax highlighting.

Thanks everyone for all your help.
-Jeff






John Peacock <jpeacock@rowman.com> on 11/16/2001 09:51:03 AM

To:   Jeff Rozycki/EB/GDYN@GDYN
cc:   Pavel Tsekov <ptsekov@syntrex.com>, cygwin@cygwin.com
Subject:  Re: script-name won't execute but script-name.py will



JROZYCKI@ebmail.gdeb.com wrote:
>
> Pavel,
> We are on NT 4.0.  I believe I have proper permissions because I can run the
> script when I tack on the script's extension, such as pl or awk.  The response
> is "command not found", not permission denied... Here is some output:
>
> bin $ pwd
> /home/jrozycki/bin
> bin $ ll
> total 51
> drwxr-xr-x    5 jrozycki users        4096 Nov 15 19:09 ./
> drwxr-xr-x   10 jrozycki users        8192 Nov 15 15:55 ../
> -rwxr-xr-x    1 jrozycki users         735 Nov 15 14:41 maxcom.py*
> <snip>
> bin $ maxcom
> bash: maxcom: command not found
> bin $ ./maxcom
> bash: ./maxcom: No such file or directory
>

The script's name is 'maxcom.py' not 'maxcom' so why would you expect CygWin
to find it?  EXE, BAT, CMD are special cases, in that you don't need to type
the extension.  There is no way to do that for arbitrary extensions either in
CygWin, Windows, or any *nix I am aware of.

Rename the file to 'maxcom' and it will work (but only as ./maxcom unless you
add '.' to your path).

HTH

John

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: script-name won't execute but script-name.py will
@ 2001-11-11  8:26 Fleischer, Karsten (K.)
  0 siblings, 0 replies; 8+ messages in thread
From: Fleischer, Karsten (K.) @ 2001-11-11  8:26 UTC (permalink / raw)
  To: 'JROZYCKI@ebmail.gdeb.com', Cygwin (E-mail)

Hi,
you _have_ to specify the extension. You have to do this on every UNIX system.
Cygwin only allows you to leave out the .exe extension.

HTH,
Karsten

> -----Original Message-----
> From: JROZYCKI@ebmail.gdeb.com [mailto:JROZYCKI@ebmail.gdeb.com]
> Sent: Freitag, 16. November 2001 14:33
> To: Pavel Tsekov
> Cc: cygwin@cygwin.com
> Subject: Re: script-name won't execute but script-name.py will
> 
> 
> Pavel,
> We are on NT 4.0.  I believe I have proper permissions 
> because I can run the
> script when I tack on the script's extension, such as pl or 
> awk.  The response
> is "command not found", not permission denied... Here is some output:
> 
> bin $ pwd
> /home/jrozycki/bin
> bin $ ll
> total 51
> drwxr-xr-x    5 jrozycki users        4096 Nov 15 19:09 ./
> drwxr-xr-x   10 jrozycki users        8192 Nov 15 15:55 ../
> -rwxr-xr-x    1 jrozycki users         735 Nov 15 14:41 maxcom.py*
> <snip>
> bin $ maxcom
> bash: maxcom: command not found
> bin $ ./maxcom
> bash: ./maxcom: No such file or directory
> bin $ maxcom.py
> 
> Incorrect Syntax - maxcom.py  char INPUTFILE  OUTPUTFILE
> bin $ path
> /cygdrive/f/bin
> /cygdrive/d/Applications
> /usr/local/bin
> /usr/bin
> /bin
> /home/jrozycki/bin
> <snip>
> 
> 
> 
> 
> 
> Pavel Tsekov <ptsekov@syntrex.com> on 11/16/2001 03:49:37 AM
> 
> To:   Jeff Rozycki/EB/GDYN@GDYN
> cc:   cygwin@cygwin.com
> Subject:  Re: script-name won't execute but script-name.py will
> 
> 
> 
> Do you have the proper permissions set on your
> script files ? Are you running a Win9x or NT ?
> 
> JROZYCKI@ebmail.gdeb.com wrote:
> >
> > Troy,
> > The interpreter line is already specfied on the first line 
> of all my scripts.
> > So something else must be the culprit.
> 
> 
> 
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-11-16 15:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-11  8:26 script-name won't execute but script-name.py will Troy Noble
  -- strict thread matches above, loose matches on Subject: below --
2001-11-11  8:26 JROZYCKI
2001-11-11  8:26 JROZYCKI
2001-11-11  8:26 ` David Starks-Browning
2001-11-11  8:26 JROZYCKI
2001-11-11  8:26 ` Pavel Tsekov
2001-11-11  8:26 Fleischer, Karsten (K.)
2001-11-11  8:26 JROZYCKI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).