* [EMAIL PROTECTED]
> #!/bin/bash
> 1st_arg=$1
number not allowed in front.

> prosesses=`lsof -i`
> prosessid=`echo $prosesses | gawk /1st_arg/'{print $2}'`
Cannot understand this to work in gawk.  In any case, you might do
this a lot more effective:

> echo $prosessid
> if [ -z "$prosessid" ]
missing "then"

> echo "not running"
> fi


> exit 0 
Not necessary


My suggestion:

#!/bin/bash
process=`lsof -i | grep $1 | gawk '{print $2 }'`
if [ "$process" = "" ]; then
  echo "not running"
else
  echo $process
fi

-- 
 Jon Haugsand, [EMAIL PROTECTED]
 http://www.norges-bank.no



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

Reply via email to