From owner-freebsd-questions Fri Jan 5 8:52:49 2001 From owner-freebsd-questions@FreeBSD.ORG Fri Jan 5 08:52:47 2001 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from ra.upan.org (upan.org [204.107.76.19]) by hub.freebsd.org (Postfix) with ESMTP id 799A737B402 for ; Fri, 5 Jan 2001 08:52:46 -0800 (PST) Received: from ocsinternet.com (localhost.upan.org [127.0.0.1]) by ra.upan.org (8.11.1/8.11.1) with ESMTP id f05BqF700458; Fri, 5 Jan 2001 11:52:15 GMT (envelope-from mikel@ocsinternet.com) Sender: mikel@ra.upan.org Message-ID: <3A55B56F.EF9666E9@ocsinternet.com> Date: Fri, 05 Jan 2001 11:52:15 +0000 From: Mikel King X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Dan Nelson Cc: freebsd-questions@FreeBSD.ORG Subject: Re: ps command References: <20010105094720.A5994@dan.emsphone.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dan Nelson wrote: > In the last episode (Jan 05), Eric_Stanfield@kenokozie.com said: > > Yeah I'd certainly be interested in the functionality. It's a pain > > in the ass moving between solaris and bsd boxes and, without fail, > > feeding ps the wrong syntax for its switches. Of course the easy > > solution on machines I have directo control over is just to alias the > > cmd to reflect its usage on the opposite OS. > > A great workaround for Solaris boxes is to put this shell script in > /usr/local/bin: > > #! /bin/sh > case $1 in > -* ) exec /usr/bin/ps "$@" ;; > * ) exec /usr/ucb/ps "$@" ;; > esac > > If you run it with dash arguments, you get sysV ps, otherwise you get > BSD ps. > > -- > Dan Nelson > dnelson@emsphone.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message I use a truely lazy one as follows. #!/bin/sh # Last Serial No. 1999111501 # MK # if [ -z $1]; then ps ax | more else ps ax |grep $1 fi I named the script ax after the two switches I use the most... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message