On Sat, 23 Jun 2007, B. Estrade wrote:
> if [ -n `ps -auxw | grep name_of_exe` ]; then
Be careful with this, as the "grep name_of_exe" will also show up in the
ps output, so this statement would always be true. You need to exclude
"grep" from ps output:
> if [ -n `ps -auxw | grep -v grep | grep name_of_exe` ]; then
Someone also mentioned pgrep. Redhat/Fedora also has /sbin/pidof. pgrep
is probably more standard though (at least on Linux/Solaris).
ray
-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Ray DeJean http://www.r-a-y.org Systems Engineer Southeastern Louisiana University IBM Certified Specialist AIX Administration, AIX Support =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ___________________ Nolug mailing list nolug@nolug.orgReceived on 06/25/07
This archive was generated by hypermail 2.2.0 : 12/19/08 EST