[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proposed new POSIX sh policy



On Sun November 19 2006 15:05, Thomas Bushnell BSG wrote:
> On Sun, 2006-11-19 at 14:53 -0700, Bruce Sass wrote:
> > On Sun November 19 2006 14:03, Thomas Bushnell BSG wrote:
> > > On Sun, 2006-11-19 at 18:43 +0100, David Weinehall wrote:
> > > > On Sat, Nov 18, 2006 at 08:01:04AM -0800, Thomas Bushnell BSG 
wrote:
> > > > > On Sat, 2006-11-18 at 11:30 +0100, Andreas Metzler wrote:
> > > > > > > Well, the goal was (in part) to catch scripts which use
> > > > > > > non-Posix features of echo and test; why are non-Posix
> > > > > > > features of ls not an issue?
> > > > > >
> > > > > > <quote>
> > > > > > Since I cannot think of a legitimate reason for anyone to
> > > > > > use ls in a shell script, I think it would add little
> > > > > > value. <unquote>
> > > > >
> > > > > Makes you wonder why it's in Posix.2 at all, huh?  (Posix.2
> > > > > is about scripts, not user interaction.)
> > > >
> > > > "The ls utility shall conform to the Base Definitions volume of
> > > > IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines."
> > > >
> > > > It's a *utility*, not a shell function.
> > >
> > > Right.  "test" and "echo" are also defined as utilities, not
> > > shell functions.
> >
> > IEEE Std 1003.1, 2004 Edition, section 2.14:
> > "The term "built-in" implies that the shell can execute the utility
> > directly and does not need to search for it. An implementation may
> > choose to make any utility a built-in..."
>
> Right.  Just like ls, or debconf.

ls is covered by the spec, debconf is not so there is nothing for it to 
conform, or not, to.

> Posix puts grep, ls, kill, test, and echo all in *exactly the same
> category*.  So why does posh treat them so differently?

In the case of ls, because the author "cannot think of a legitimate 
reason for anyone to use ls in a shell script", and he thinks "it would 
add little value." Presumably grep is in the same boat.

> Why is
> catching non-Posix uses of test and echo important, and non-Posix
> uses of ls grep not important?

I would expect that sh scripts which use non-spec'd features of ls or 
grep would be open to receiving bug reports for violating Policy. Why 
do you think that is not the case?


- Bruce



Reply to: