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/099324.html below:

problem executing python scripts in cygwin bash shell

problem executing python scripts in cygwin bash shell problem executing python scripts in cygwin bash shellDouglas Alan nessus at mit.edu
Sat Apr 7 16:39:24 EDT 2001
"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?

No, I don't normally do Windoze, but your script has several problems:

   (1) There should be no spaces around the "=" in 

          temp = "$@ "

   (2) Your script will not work right if any of the arguments to the script
       has spaces in it.

   (3) It leaves an extra bash processes sitting around for no good
       reason while your python program is running.

Here's an update to my version that fixes the problem you pointed out:

   #!/bin/sh

   cp=`cygpath -w $1`
   shift   
   exec //d/apps/Python20/python "$cp" ${1+"$@"}

If you are using bash (as opposed to the Bourne shell) you can replace

   ${1+"$@"}

with 

   "$@"

if you are so inclined.

|>oug

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