| The Following User Says Thank You to Crugath For This Useful Post: | ||
#!/bin/bash
IFS=$'\n'
for LINE in `wmctrl -lp `; do
if [ ${LINE:2:2} -gt 1 ]; then
PID=`echo "$LINE" | awk '{print $3}'`
PTITLE=`echo $LINE | awk '{print $5}'`
echo "Killing $PID ($PTITLE)"
kill $PID
fi
done
cd /home/user/ sh close_all.sh
close_all.sh: line 5: syntax error: Bad substitution
chmod +x close_all.sh
./close_all.sh
.

.| The Following User Says Thank You to SAABoy For This Useful Post: | ||