1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-01 15:33:07 -07:00
rc/sh/unscreen

17 lines
339 B
Bash
Executable File

#!/usr/bin/env zsh
# YES_ZSH
# NO_BASH
# NO_DASH
unscreen() { ### @-
### i don't use this anymore~
local pids="$(screen -ls | fgrep "$1" | cut -d. -f1)"
for pid in $=pids; do
local ppid="$(ps h --ppid "$pid" -o pid)"
kill $=ppid || return 1
done
return 0
}
[ "${SOURCING:-0}" -gt 0 ] || unscreen "$@"