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

Re: Proposed new POSIX sh policy

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.

The volume is called "Shell & Utilities".  Other covered utilities are
*for instance* awk, bc, chmod, chown, diff, and grep.

> How about grep?  Is there a legitimate reason to use grep?  Can we have
> a list of which Posix.2 shell commands may not be legitimately used in
> shell scripts?

There are definitely lots of reasons to include grep in shell scripts,
though some of the current users can probably be covered by the
${}-variants.  And for a shell like busybox it makes sense to
have both ls and grep as builtins...

Things not acceptable from SuSv3 would for instance include the entire
BE-section (Batch Environment Services -- then again I'm not even sure
it's provided by anything in Debian), the FR-extensions (Fortran
Runtime), most (all?) of the utilities marked as DEVELOPMENT (things
such as compilers, sccs-related commands, cflow, and ctags).

Regards: David
 /) David Weinehall <tao@debian.org> /) Rime on my window           (\
//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   //  Diamond-white roses of fire //
\)  http://www.acc.umu.se/~tao/    (/   Beautiful hoar-frost       (/

Reply to: