From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 12:46:24 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 691B516A4CE; Fri, 26 Mar 2004 12:46:24 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4695743D55; Fri, 26 Mar 2004 12:46:24 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc11) with SMTP id <2004032620462301300fv4a6e>; Fri, 26 Mar 2004 20:46:23 +0000 From: Albert Cahalan To: arch@freebsd.org Content-Type: text/plain Organization: Message-Id: <1080334271.2255.1301.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 26 Mar 2004 15:51:11 -0500 Content-Transfer-Encoding: 7bit cc: das@freebsd.org cc: drosih@rpi.edu cc: cyrille.lefevre@laposte.net Subject: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 20:46:24 -0000 Cyrille Lefevre writes: > two years ago, I've added posix syntax and so to my locally ps(1). > for instance, I'm currently adding the notion of dynamic personalities OK, would YOU be interested in working with me on some sort of common ps specification beyond what SUSv3 has to offer? I'd love to see something that Sun could adopt, and that could be mostly merged into the next revision of the standard. > (the term comes from linux) instead of static #define such as... say : > > $ ps -X help > any bsd bsd43reno bsd44 default extended freebsd hpux irix netbsd none openbsd > pedantic posix relaxed solaris sunos susv3 tru64 So you use "-X" as an escape into long options? Why not "--help"? > personalities enable options such as : > bsd ps : > -g and -n from sunos, -s from tru64 and some other options. > posix ps : see susv3 man (see > http://www.opengroup.org/onlinepubs/007904975/toc.htm) > -j from all except posix > -c, -y and -P from solaris > -C cmdlist (ala pgrep :) and -x from hpux That "-x" will hurt you. Without it, it is easy for a SUSv3 parser to detect the common old "ps -ax" syntax. BTW, I have a regression test suite that you might find useful. > -M from irix Do you have documentation or examples for this? > and some others > they also enable many keywords such as : > RUSAGE and co from tru64, class and psr from solaris, and many others > (mostly aliases) > > when finished, I'll probably submit these changes as a port in the meantime > since I suppose -arch will reject these important changes to a native command. > the most important and not done part is... the manual page. any volonteers ? Step 1: a. ps does old BSD behavior by default b. /posix/bin/ps is a script that sets the SUSv3 personality c. /usr/ucb/ps is a link to /bin/ps Step 2: a. ps does SUSv3 by default b. /posix/bin/ps is a link to /bin/ps c. /usr/ucb/ps is a script that sets the old BSD personality > $ PERSONALITY=susv3,+extended ps -? > usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] > [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] > [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] > ps -o help > ps -X help What syntax do you use for PERSONALITY settings? Let's do something compatible. The name isn't so good. Tru64 uses CMD_ENV for this, affecting more than just ps. I made PS_PERSONALITY take priority so that you could change ps behavior without changing other behaviors. You forgot the "-F" from DYNIX/ptx. It's really nice.