shebang strange thing...

jepler at unpythonic.net jepler at unpythonic.net
Mon Jun 23 09:30:05 EDT 2003


> "Mel Wilson" <mwilson at the-wire.com> a écrit dans le message de news:
> yKH9+ks/KvvV089yn at the-wire.com...
> >    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.
> 
On Mon, Jun 23, 2003 at 12:49:37PM +0200, Gilles Lenfant wrote:
> IMHO, it's "buggy" :
> 
> * most unix/windows/macos modern tools accept any end of line mark, like
> Python does.
> 
> * the errror message points the user to a bad direction.

So fix it.  Something like this should do the trick:

$ su - 
Password: 1234
% for d in /bin /usr/bin /usr/local/bin; do cd $d; for i in *; do ln -s $i
`printf '%s\r' $i`; done; done
% exit

Jeff





More information about the Python-list mailing list