From owner-freebsd-questions Wed May 10 9:22: 1 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 5F4E337B67F for ; Wed, 10 May 2000 09:21:55 -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 MAA60331; Wed, 10 May 2000 12:20:08 -0400 (EDT) Date: Wed, 10 May 2000 12:20:08 -0400 (EDT) From: Matthew Emmerton To: keramida@ceid.upatras.gr Cc: freebsd-questions@freebsd.org Subject: Re: Problem with pipes and ps In-Reply-To: <20000510144144.19510.qmail@zenon.ceid.upatras.gr> 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 On Wed, 10 May 2000 keramida@ceid.upatras.gr wrote: > On Wed, May 10, 2000 at 09:51:41AM -0400, Matthew Emmerton wrote: > > > > 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: > > Try using this: > > #!/bin/sh > PING_PROG="ps -ax | grep apache" > eval "${PING_PROG}" > > Then the commands that result from the expansion of PING_PROG will > be executed by your shell. > > - giorgos keramidas Of course! I feel *so* stupid. It works, I'm happy, and forever indebted :) -- Matthew Emmerton IT Specialist Computer Partners To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message