#!/bin/sh for i do psu | awk '$NF ~ /^('$i')$/ {printf("/bin/kill -9 %d # %s\n", $2, $0);}' done