X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=kill-unused-xterms.sh;h=21258baae092a5c6a7a37cbeab30a54a10917fd4;hb=6473993b691c6280c4ad1d1d9a3b697eb0e05eb2;hp=6ea3058a8a1153e34c78d8757cc7729ec2a4eab0;hpb=2b983c5c7336826b764036e3e1478a5a8159248a;p=scripts.git 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