Jon Haugsand wrote:
Another point is: if you want the PID of the currently processing shell (ie. the one that interprets your script), then according to man bash you can just use the special variable $, like in '$$'.* [EMAIL PROTECTED]#!/bin/bash 1st_arg=$1number 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" fiexit 0Not necessary My suggestion: #!/bin/bash process=`lsof -i | grep $1 | gawk '{print $2 }'` if [ "$process" = "" ]; then echo "not running" else echo $process fi
/jan
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list