2010-05-04 16:07:25 +0000, Gerrit Pape: > On Tue, Oct 28, 2008 at 04:51:03PM +0000, Stephane Chazelas wrote: > > Hiya, > > > > $ ash -c '. -- --help' > > .: 1: --: not found > > > > The handling of "--" is mandated by POSIX I beleive. > > > > With ksh, pdksh, bash and in a POSIX script in general as POSIX > > allows any "." implementation to recognise options, you have to > > use: > > > > . -- "$1" > > > > if you can't guarantee that "$1" won't start with a "-". > > > > Unfortunately, that code doesn't work with ash, so a POSIX > > script written in such a robust way will fail on those systems > > where ash is the POSIX sh interpreter. [...] > the dot special builtin doesn't know about the -- option according to > posix, and 'conforming application shall not use that argument'. > > See > > http://www.opengroup.org/onlinepubs/009695399/utilities/dot.html > > http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_14 [...]
Hi Gerrit, it does. See SUSv4 (POSIX 2008) http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_04 SUSv4> OPTIONS [...] SUSv4> Default Behavior: When this section is listed as "None.", it SUSv4> means that the implementation need not support any options. SUSv4> Standard utilities that do not accept options, but that do SUSv4> accept operands, shall recognize "--" as a first argument to SUSv4> be discarded. SUSv4> SUSv4> The requirement for recognizing "--" is because SUSv4> conforming applications need a way to shield their SUSv4> operands from any arbitrary options that the SUSv4> implementation may provide as an extension. For SUSv4> example, if the standard utility foo is listed as SUSv4> taking no options, and the application needed to give SUSv4> it a pathname with a leading <hyphen>, it could safely SUSv4> do it as: SUSv4> SUSv4> foo -- -myfile There's the same text in the older SUSv3 POSIX 2004 which you're quoting (http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11). -- Stephane -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org