Re: [PATCH] Linux 2.6: shebang handling in fs/binfmt_script.c

From: Hansjoerg Lipp
Date: Mon Feb 23 2004 - 15:29:29 EST


On Sun, Feb 22, 2004 at 09:42:55PM -0800, Paul Jackson wrote:
> > #!/usr/bin/awk -F \t -f
>
> If your primary need is to set the awk field separator, how about
> setting FS (or IFS, depending on which awk) in a BEGIN section
> in the script?

Well, this was just the example we used in the discussion I mentioned.
In this case you are right. But what about

#!/usr/bin/awk --posix -f

to enable expressions like [0-9]{1,2}. There are really usefull
parameters for awk, shells, ... you can't use easily in scripts (IIRC,
perl has to parse the shebang line on its own because of this - although
this is really not the job of an interpreter.)

The "\" part: Yes, there are not many examples, where you really need
this, because it's not that likely to have filenames or parameters
containing spaces. That's why I said, this part could get some
"#ifdef CONFIG_SHEBANG_ESCAPE" or could even be deleted from the patch.

Here, I'd like to know what people consider more important:
compatibility for old scripts with shebang lines containing backslashes
or the possibility to have file names or paramaters containing white
space characters.

Regards,

Hansjoerg Lipp
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/