>Jon Haugsand wrote: >> * [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 >> >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 '$$'. > >/jan Thanks Jan just learned a bunch ! Guess I'll go and RTFM :) RGDS Lars -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list