From owner-freebsd-standards Sat Oct 26 14:15:47 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 B3E5637B401 for ; Sat, 26 Oct 2002 14:15:45 -0700 (PDT) Received: from thuvia.demon.co.uk (thuvia.demon.co.uk [193.237.34.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A41043E3B for ; Sat, 26 Oct 2002 14:15:44 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (dotar.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.12.3/8.12.3) with ESMTP id g9QLFfcF054444; Sat, 26 Oct 2002 22:15:42 +0100 (BST) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (localhost [IPv6:::1]) by dotar.thuvia.org (8.12.6/8.12.6) with ESMTP id g9QLFfH5014716; Sat, 26 Oct 2002 22:15:41 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.6/8.12.6/Submit) id g9QLFeCw014715; Sat, 26 Oct 2002 22:15:40 +0100 (BST) Date: Sat, 26 Oct 2002 22:15:40 +0100 (BST) From: Mark Valentine Message-Id: <200210262115.g9QLFeCw014715@dotar.thuvia.org> In-Reply-To: <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: Garrett Wollman Subject: Re: /usr/posix: a first cut Cc: freebsd-standards@freebsd.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 > From: Garrett Wollman > Date: Sat 26 Oct, 2002 > Subject: Re: /usr/posix: a first cut > Actually, portable scripts do the following: > > PATH=$(command -p getconf PATH) > > and should never supply explicit paths to the Standard Utilities > (unless it cares to go to the effort of emulating execve() all by > itself). Eek! Portable != POSIX (despite all the good POSIX does for steering everyone in the same direction eventually). My portable scripts use neither $(anything) nor getconf. Maybe next century... Sheesh, FreeBSD 4.7 doesn't even _have_ getconf(1), and Solaris 9 /bin/sh still doesn't support $(foo). > So any move to create a ghetto for Standard-compliant utilities must > perforce update the Standard Path to put the directory containing the > Standard utilities first. 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). So posix(7) should state something like: The default FreeBSD command environment is as close as possible to POSIX.1 without introducing backwards compatibility issues. In order to set up a more complete POSIX-compliant environment, it is sufficient to place /usr/posix at the start of your PATH (or at least before /bin and /usr/bin). NOTE: placing /usr/posix early in your PATH may adversely effect any non-POSIX utilities you cause to run, and is not intended for general use. EXAMPLES % env PATH=/bin:/usr/bin expr -1 + 2 1 % env PATH=/bin:/usr/bin expr -- hello : '.*' expr: syntax error % env PATH=/usr/posix:/bin:/usr/bin expr -1 + 2 expr: illegal option -- 1 usage: expr [-e] expression % env PATH=/usr/posix:/bin:/usr/bin expr -- hello : '.*' 5 SEE ALSO environ(7) Cheers, Mark. -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message