#!/bin/sh echo "findPort $1" while true do pid=`findPortPid $1` if [ -z $pid ] then echo "pid not found!!!" sleep 1s else echo "pid is $pid" touch $pid.log && chmod +x $pid.log break fi done