1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 08:19:03 -08:00
rc/sh/unscreen

13 lines
239 B
Text
Raw Normal View History

2015-12-06 12:35:57 -08:00
#!/usr/bin/env zsh
unscreen() {
local pids="$(screen -ls | fgrep "$1" | cut -d. -f1)"
for pid in $=pids; do
local ppid="$(ps h --ppid "$pid" -o pid)"
2016-01-05 05:38:34 -08:00
kill "$ppid" || return 1
2015-12-06 12:35:57 -08:00
done
2016-01-05 05:38:34 -08:00
return 0
2015-12-06 12:35:57 -08:00
}
unscreen "$@"