[Tutor] Is there space a between "#!" and "/usr/bin/env python" ?

Alan Gauld alan.gauld at btinternet.com
Wed May 2 03:49:29 CEST 2012


On 02/05/12 01:27, Steven D'Aprano wrote:

>> If it's Unix it depends on the variety, but usually no space is needed.
>
> As far as I know, on any Unix, Linux or other POSIX system, the presence
> or absence of a space between the #! and the path is irrelevant.

So far as I know you are right. One thing nobody has mentioned is that
the presence of a space between the # and ! will usually (always?) not 
work. I have been caught out by that before...

ie

#! /bin/sh
#!/bin/sh

will both work

# ! /bin/sh
# !/bin/sh
will not.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list