dotfiles/.scripts/kapp.sh

10 lines
266 B
Bash
Executable File

#!/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