dotfiles/.scripts/kapp.sh

10 lines
266 B
Bash
Raw Normal View History

2020-09-11 23:48:00 -07:00
#!/usr/bin/env zsh
# kill all instances of an application
[[ -z "$@" ]] && exit
application_name="$(echo "$1" | awk '{print tolower($0)}')"
ps aux | grep "$application_name" | grep -v 'grep' | awk '{print $2}' | while read process; do
kill -9 "$process"
done