From owner-freebsd-standards Sat Oct 26 15:24: 8 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B03E337B401 for ; Sat, 26 Oct 2002 15:24:06 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 054ED43E75 for ; Sat, 26 Oct 2002 15:24:06 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9QMO4gQ026013 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 26 Oct 2002 18:24:05 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9QMO4pw026010; Sat, 26 Oct 2002 18:24:04 -0400 (EDT) (envelope-from wollman) Date: Sat, 26 Oct 2002 18:24:04 -0400 (EDT) From: Garrett Wollman Message-Id: <200210262224.g9QMO4pw026010@khavrinen.lcs.mit.edu> To: Mark Valentine Cc: freebsd-standards@FreeBSD.ORG Subject: Re: /usr/posix: a first cut In-Reply-To: <200210262115.g9QLFeCw014715@dotar.thuvia.org> References: <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> <200210262115.g9QLFeCw014715@dotar.thuvia.org> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < 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