Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70506

Re: Strange syntax error, occurs only when script is executed directly

References <mailman.9431.1398162667.18130.python-list@python.org> <5356625a$0$29993$c3e8da3$5496439d@news.astraweb.com>
Date 2014-04-22 22:52 +1000
Subject Re: Strange syntax error, occurs only when script is executed directly
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.9438.1398171515.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Apr 22, 2014 at 10:36 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
>> These are the 15 first lines of the script:
>>
>> #! /opt/local/bin/python
>
> This being Solaris, what happens if you remove the space between the hash-
> bang and the path? On Linux it makes no difference, but Solaris tends to
> be a bit more idiosyncratic about things like this.

I'm pretty sure the POSIX standard stipulates that a space there is
optional. Should be no difference between "#!/" and "#! /" on any
compliant OS. (But I can't right now find a citation for that, so I
may be wrong.)

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Strange syntax error, occurs only when script is executed directly Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-04-22 12:29 +0200
  Re: Strange syntax error, occurs only when script is executed directly Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-22 12:36 +0000
    Re: Strange syntax error, occurs only when script is executed directly Chris Angelico <rosuav@gmail.com> - 2014-04-22 22:52 +1000
      Re: Strange syntax error, occurs only when script is executed directly Andrew Cooper <root@127.0.0.1> - 2014-04-23 02:28 +0100
    Re: Strange syntax error, occurs only when script is executed directly Tim Chase <python.list@tim.thechases.com> - 2014-04-22 08:22 -0500
    Re: Strange syntax error, occurs only when script is executed directly Chris Angelico <rosuav@gmail.com> - 2014-04-22 23:26 +1000

csiph-web