[EMAIL PROTECTED] wrote:
I'm trying to get a pidof a php script by capturing the path:
like /home/somebody/my_script which will be the first arg. to the bash script

Could anybody tell me what's wrong with this script ?

I'm new to scripting in general so any help would be apreciated !


#!/bin/bash
1st_arg=$1
prosesses=`lsof -i`
prosessid=`echo $prosesses | gawk /1st_arg/'{print $2}'`
>
In your awk stmt you search for '1st_arg' rather than the value of the variable 1st_arg, which would be $1st_arg - or perhaps ${1st_arg}, as $1 is something else...

echo $prosessid
if [ -z "$prosessid" ]
echo "not running"
fi
exit 0


--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to