From owner-freebsd-standards Sat Oct 26 15:57:46 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 95B0D37B401 for ; Sat, 26 Oct 2002 15:57:44 -0700 (PDT) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id C17C043E4A for ; Sat, 26 Oct 2002 15:57:43 -0700 (PDT) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 83B359C0E; Sat, 26 Oct 2002 18:49:28 -0400 (EDT) Date: Sat, 26 Oct 2002 18:49:28 -0400 From: Mike Barcroft To: Mark Valentine Cc: freebsd-standards@freebsd.org Subject: Re: /usr/posix: a first cut Message-ID: <20021026184928.E47672@espresso.q9media.com> References: <20021026143724.D47672@espresso.q9media.com> <200210261944.g9QJiErS012646@dotar.thuvia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200210261944.g9QJiErS012646@dotar.thuvia.org>; from mark@thuvia.demon.co.uk on Sat, Oct 26, 2002 at 08:44:14PM +0100 Organization: The FreeBSD Project 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 Mark Valentine writes: > > From: Mike Barcroft > > Date: Sat 26 Oct, 2002 > > Subject: Re: /usr/posix: a first cut > > > I would prefer to have /usr/posix/bin and /usr/posix/man. I think > > manuals will get too cluttered if we try to document two differing > > utilities in one manual. > > I was hoping this wouldn't get that much out of hand; I see the > differences being very small. I don't. Take for instance /usr/posix/bin/ps which will be completely different, with many conflicting options. > Most users will never see the POSIX-related manual pages if they > are separate. Users that don't need POSIX-conformant applications won't need to read about conformant versions and vice versa. > Do you know of any other systems which take this approach? I've > sort of been following Solaris' style, which I've found to be effective. Take a look at the sccs(1) manual on Solaris to see why I think manuals get cluttered when you go that route. > > I think we should suggest in posix(7) that users seeking conformant > > utilities change their PATH and MANPATH. > > I explicitly didn't do that, because I think /usr/posix is there for > script writers, not users. I think both will be using it. > In fact, putting /usr/posix at the start of your path is more likely > to _break_ the scripts you run. I use a different shell for scripting (/bin/sh) vs. my regular shell (/bin/tcsh). A run of w(1) on freefall shows I'm not alone, 0/27 users are running sh(1). I believe most advanced Bourne shells define something to distinguish themselves from regular /bin/sh, so it shouldn't be a problem to change the path only for interactive sessions. > Portable scripts don't hardwire paths for standard executables, they > rely on a reasonable default environment for the platform which behaves > as that platform normally does (there are exceptions to this rule, of > course). > > An example would be a script which knows that all its target platforms > support a POSIX.1 expr(1) command, even if it's not the default behaviour: > > #!/bin/sh > > case `uname` in > FreeBSD) expr=/usr/posix/expr;; > SunOS) expr=/usr/xpg4/bin/expr;; > *) expr=expr;; > esac > > ... use $expr ... > > Note that the default in absence of any better knowledge is "hope and pray". [Garrett covered this.] Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message