Re: [PATCH] Re: #! incompatible -- binfmt_script.c broken?

From: Petr Vandrovec (VANDROVE@vc.cvut.cz)
Date: Wed Dec 04 2002 - 14:22:46 EST


On 4 Dec 02 at 18:52, mbm@mort.demon.co.uk wrote:
> > single argument but strips trailing whitespace. NetBSD does the same as
> > Linux but passes trailing whitespace as part of the argument.
>
> NetBSD is also broken, in that case. Everything I ever used that
> supported #! except linux worked sensibly. I even wrote myself
> a patch, which still applied to 2.4 fairly recently. It's not
> perfect (has a fixed number of args to avoid allocating from the
> heap, would be easy to change), but it's functional.

Without adding support to parse " and ' it is unacceptable. I have
dozens of scripts which use argument with spaces inside... Also
all references I was able to found talks about "single optional
argument" (SCO, AIX)... Try running script containing

#! /bin/ls a b c

on your favorite system. If it will report
'/bin/ls: a b c: No such file or directory', or
'ls: 0653-341 The file a b c does not exist', system does not split
argument on spaces. If it will talk about 'a' not found, it splits them
on spaces.

And because of I was not able to find anything in POSIX which would say
that we should do split on spaces (not that I found that we should not),
I vote for leaving current behavior in Linux, and fixing perl manpage
(and eventually FreeBSD, if anyone is interested) instead.
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz
                                                    
                                                    
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 07 2002 - 22:00:19 EST