By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,525 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,525 IT Pros & Developers. It's quick & easy.

shebang in cross platform scripts

P: n/a
rbt

Haven't tested this on Windows yet... thought I'd ask here:

Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python

Many thanks,

rbt

Jul 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Apr 6, 2005 2:37 PM, rbt <rb*@athop1.ath.vt.edu> wrote:
Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Nope. On Windows it's just a comment.

--
Cheers,
Simon B,
si***@brunningonline.net,
http://www.brunningonline.net/simon/blog/
Jul 18 '05 #2

P: n/a
rbt wrote:

Haven't tested this on Windows yet... thought I'd ask here:

Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Thanks to the # being the comment sign in python, it will be silently
discarded by windows.

--
Regards,

Diez B. Roggisch
Jul 18 '05 #3

P: n/a
On Apr 6, 2005 9:37 AM, rbt <rb*@athop1.ath.vt.edu> wrote:

Haven't tested this on Windows yet... thought I'd ask here:

Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


What the others have said already is true, that it will be ignored on
windows, with one caveat. The shebang is interpreted by Apache if your
script is a CGI script. So, if your script is a CGI, you will need to
have a windows version and a nix version.

Peace
Bill Mill
bill.mill at gmail.com
Jul 18 '05 #4

P: n/a
Hi All--

Simon Brunning wrote:

On Apr 6, 2005 2:37 PM, rbt <rb*@athop1.ath.vt.edu> wrote:
Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Nope. On Windows it's just a comment.


It works fine using cygwin, uwin, mks and pdksh, all available for
Windows. Google is your friend.

Symbolic links also work under uwin (don't know for sure about the
others). That means you can install a link in /usr/bin to whereever
python lives, and expect #!/usr/bin/python to work just fine.

Metta,
Ivan
----------------------------------------------
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/worksh...oceedings.html
Army Signal Corps: Cu Chi, Class of '70
Author: Teach Yourself Python in 24 Hours
Jul 18 '05 #5

P: n/a
On Apr 6, 2005 11:06 AM, Ivan Van Laningham <iv*****@pauahtun.org> wrote:
Hi All--

Simon Brunning wrote:

On Apr 6, 2005 2:37 PM, rbt <rb*@athop1.ath.vt.edu> wrote:
Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Nope. On Windows it's just a comment.


It works fine using cygwin, uwin, mks and pdksh, all available for
Windows. Google is your friend.

Symbolic links also work under uwin (don't know for sure about the
others). That means you can install a link in /usr/bin to whereever
python lives, and expect #!/usr/bin/python to work just fine.


This works in cygwin as well; I didn't mention cygwin since the OP
seemed to be asking about windows distribution, but it's a good point.

Peace
Bill Mill
Jul 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.