[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6124: basename/dirname are not POSIX compliant on arg starting with
From: |
Vincent Lefevre |
Subject: |
bug#6124: basename/dirname are not POSIX compliant on arg starting with a dash |
Date: |
Thu, 6 May 2010 16:24:10 +0200 |
User-agent: |
Mutt/1.5.20-6083-vl-r35499 (2010-04-24) |
On 2010-05-06 07:41:59 -0600, Eric Blake wrote:
> No, you're missing one other key point of POSIX:
>
> http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html
> Section 1.4, OPTIONS:
>
> Default Behavior: When this section is listed as "None.", it means
> that the implementation need not support any options. Standard utilities
> that do not accept options, but that do accept operands, shall recognize
> "--" as a first argument to be discarded.
OK, an alternative way would be that an exception is added to POSIX,
just like for "echo".
> The requirement for recognizing "--" is because conforming
> applications need a way to shield their operands from any arbitrary
> options that the implementation may provide as an extension. For
> example, if the standard utility foo is listed as taking no options, and
> the application needed to give it a pathname with a leading <hyphen>, it
> could safely do it as:
>
> foo -- -myfile
>
> and avoid any problems with -m used as an extension.
However, if extensions are allowed, this would mean that many scripts
would have to be fixed.
--
Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
bug#6123: basename/dirname are not POSIX compliant on arg starting with a dash, Vincent Lefevre, 2010/05/06
bug#6124: basename/dirname are not POSIX compliant on arg starting with a dash, Eric Blake, 2010/05/06