Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Oct 2002 18:24:04 -0400 (EDT)
From:      Garrett Wollman <wollman@lcs.mit.edu>
To:        Mark Valentine <mark@thuvia.demon.co.uk>
Cc:        freebsd-standards@FreeBSD.ORG
Subject:   Re: /usr/posix: a first cut
Message-ID:  <200210262224.g9QMO4pw026010@khavrinen.lcs.mit.edu>
In-Reply-To: <200210262115.g9QLFeCw014715@dotar.thuvia.org>
References:  <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> <200210262115.g9QLFeCw014715@dotar.thuvia.org>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Sat, 26 Oct 2002 22:15:40 +0100 (BST), Mark Valentine <mark@thuvia.demon.co.uk> said:

> Portable != POSIX (despite all the good POSIX does for steering everyone
> in the same direction eventually).

Quite to the contraty.  POSIX, and other formal standards, define the
behavior portable applications can expect.  An application which
contains work-arounds for non-standard systems is merely ported, not
necessary portable.

> Sheesh, FreeBSD 4.7 doesn't even _have_ getconf(1),

FreeBSD 4.7 doesn't claim compliance to POSIX.2, so all bets are off.
A script can only hope that the PATH includes utilities which do the
right thing.

> and Solaris 9 /bin/sh
> still doesn't support $(foo).

That's because the only POSIX-compliant shell on Solaris is called
`/usr/xpg4/bin/sh'.  Since /usr/xpg4/bin is the first directory in the
standard PATH, this is OK (even if confusing and poor QOI).  (There
seem to be other problems, though, at least in my quick inspection,
some of which may be due to the fact that I don't use `sh' as my
standard shell on the one Solaris machine I have easy access to.)

> OK, you're right that there should be a way to get a Standard environment
> (as opposed the default as-near-as-possible-but-still-BSD-when-it-comes-
> to-the-crunch environment).

The Standard defines a self-consistent environment, and a way
(`getconf -p PATH') for any script to ensure that it gets it.  You'll
have to change many more utilities than just `sort' to go down that
path.  (Look at /usr/xpg4/bin on a Solaris machine to get an idea of
how many utilities are broken by default on that platform.)

>     % env PATH=/bin:/usr/bin expr -1 + 2
>     1

Examples should be given in Standard (i.e., Bourne Shell) syntax.  In
any case, this is a red herring, since the expr(1) manual page gives
generous advice as to how to use the `expr' command in a way which
will work identically on both pre-POSIX and POSIX-standard `expr'
implementations.  Rather than pile kluge on top of hack on top of
bogus workaround, just fix your scripts.

-GAWollman


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210262224.g9QMO4pw026010>