From owner-freebsd-questions Wed May 10 6:53:22 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail.compar.com (mail.compar.com [216.208.38.130]) by hub.freebsd.org (Postfix) with ESMTP id 284B937B5C7 for ; Wed, 10 May 2000 06:53:18 -0700 (PDT) (envelope-from matt@skippyii.compar.com) Received: from localhost (matt@localhost) by mail.compar.com (8.9.3/8.9.3) with ESMTP id JAA56986 for ; Wed, 10 May 2000 09:51:41 -0400 (EDT) Date: Wed, 10 May 2000 09:51:41 -0400 (EDT) From: Matthew Emmerton To: freebsd-questions@freebsd.org Subject: Problem with pipes and ps Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I've got this shell program (part of a home-made sysadmin package): #!/bin/sh PING_PROG="/bin/ps -ax | /usr/bin/grep apache" ${PING_PROG} My thought is that this should run the command(s) contained in PING_PROG. However, this is the output I get: root@skippyii# sh -x ./check_apache.sh + PING_PROG=/bin/ps -ax | /usr/bin/grep apache + /bin/ps -ax | /usr/bin/grep apache ps: |: No such file or directory root@skippyii# I'm thorougly confused. I know this can be done, but I can't seem to figure out how. Any help would be appreciated. -- Matthew Emmerton Computer Partners IT Specialist To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message