Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2000 09:51:41 -0400 (EDT)
From:      Matthew Emmerton <matt@skippyii.compar.com>
To:        freebsd-questions@freebsd.org
Subject:   Problem with pipes and ps
Message-ID:  <Pine.BSF.4.10.10005100947380.56953-100000@skippyii.compar.com>

next in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10005100947380.56953-100000>