From owner-freebsd-questions Sun Nov 24 22:11:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5F8B37B401 for ; Sun, 24 Nov 2002 22:11:49 -0800 (PST) Received: from the-frontier.org (ns1.the-frontier.org [216.86.199.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D52143E88 for ; Sun, 24 Nov 2002 22:11:41 -0800 (PST) (envelope-from pscott@skycoast.us) Received: from [192.168.66.249] (dhcp-249-66-168-192.the-frontier.org [192.168.66.249]) by the-frontier.org (8.9.3/8.9.3) with ESMTP id WAA07644; Sun, 24 Nov 2002 22:11:36 -0800 (PST) (envelope-from pscott@skycoast.us) User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Sun, 24 Nov 2002 22:11:35 -0800 Subject: Re: .sh interactive ok, from crontab, not From: "Paul A. Scott" To: Len Conrad , Message-ID: In-Reply-To: <5.1.1.6.2.20021125005050.01e0c638@mail.go2france.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Oh, besides (or instead of) using the -w flag, you might also consider just shorting the width of the output lines. Since you don't need all the information between the user and command fields, you could just use: if ( ps -ax -o user,command | grep -iq "^root.*master" ) ; then Another possibility arises when a daemon writes its own process id into /var/run/ when it starts up, and removes it on termination. So, you could possibly test for the existence of the .pid file, such as: if [ -f /var/run/master.pid ] ; then Hope this helps. Paul -- Paul A. Scott mailto:pscott@skycoast.us http://skycoast.us/pscott/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message