X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=kill-unused-xterms.sh;h=21258baae092a5c6a7a37cbeab30a54a10917fd4;hp=6ea3058a8a1153e34c78d8757cc7729ec2a4eab0;hb=0c7aaabde9bf206dd017f468bf5af86e2efb22dd;hpb=5d2e211f0e3dbd1b497b41f4f0c2524eeb9aed32 diff --git a/kill-unused-xterms.sh b/kill-unused-xterms.sh index 6ea3058..21258ba 100755 --- a/kill-unused-xterms.sh +++ b/kill-unused-xterms.sh @@ -28,7 +28,7 @@ SHELL_NAME=bash for ppid in $(ps h -C xterm -o pid); do N=0 for pid in $(ps h --ppid $ppid -o pid,cmd | awk '{ if($2 == "'${SHELL_NAME}'") { print $1 }}'); do - K=$(ps h --ppid $pid -o cmd,pid | wc -l) + K=$(ps h --ppid $pid -o pid | wc -l) N=$((N+K+1)) done if [[ $N == 1 ]]; then