shebang strange thing...

Mel Wilson mwilson at the-wire.com
Sat Jun 21 10:58:58 EDT 2003


In article <uZSIa.534$sF6.54902840 at newssvr21.news.prodigy.com>,
Van Gale <news at exultants.org> wrote:
>Erik Max Francis wrote:
>> Van Gale wrote:
>>>There's a very subtle bug (feature?) in bash (and maybe other shells?)
>>>that will generate this error if the line is terminated with a CR/LF
>>>pair instead of just a linefeed.
>> Yes, it's common to other shells.  It's not a feature, but it's not a
>> "bug" per se -- using CR LF terminated text files on Unix is operator
>> error.

>Well guess what, it happens.  It even happens when the "operator" is
>aware of the problem.  So lets not call it a bug, and instead call it
>poor programming because the error message is not only incorrect, but
>will also waste a fair amount of time of someone trying to debug the
>problem because it points them in the wrong direction.

   It's understandable once you realize that the shell
thinks the '\r' is part of the filename.  Just like

    os.execv ('/usr/bin/python\r', ('myfile.py',))

        Regards.        Mel.




More information about the Python-list mailing list