A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/109065.html below:

problem executing python scripts in cygwin bash shell

problem executing python scripts in cygwin bash shellJohn J. Lee phrxy at csv.warwick.ac.uk
Fri Apr 6 21:25:11 EDT 2001
On 6 Apr 2001, Douglas Alan wrote:

> "John J. Lee" <phrxy at csv.warwick.ac.uk> writes:
>
> > Aha!  Good idea.  Perhaps even better:
>
> > #!/bin/sh
>
> > temp = "$@ "
> > //d/apps/Python20/python `cygpath -w $1` ${temp#* }
>
> Good idea, but not quite right.  You really want:
>
>   #!/bin/sh
>
>   exec //d/apps/Python20/python "`cygpath -w $1`" ${1+"$@"}
[...]

Hmm, have you actually tried executing that?

I'm no fan of shell scripting and tend to avoid it, so perhaps I'm missing
something, but your modification of my little script doesn't appear to
work (tst.py just prints out sys.argv).

Your script:

$ //c/Python20/Local/tst.py

['c:\\Python20\\Local\\tst.py', '//c/Python20/Local/tst.py']

$ //c/Python20/Local/tst.py foo bar

['c:\\Python20\\Local\\tst.py', '//c/Python20/Local/tst.py', 'foo', 'bar']


My script:

$ //c/Python20/Local/tst.py

['c:\\Python20\\Local\\tst.py']

$ //c/Python20/Local/tst.py foo bar

['c:\\Python20\\Local\\tst.py', 'foo', 'bar']



tst.py looks like this:

#!/usr/bin/env python

import sys

print sys.argv


(did that test just as my laptop's batteries were going flat, so apologies
for any typos)



John


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4