Skip to content

Instantly share code, notes, and snippets.

@dmcaulay
Created September 4, 2013 19:14
Show Gist options
  • Save dmcaulay/6441497 to your computer and use it in GitHub Desktop.
Save dmcaulay/6441497 to your computer and use it in GitHub Desktop.
s = open "| screen -r"
s.each do |sess|
pid = /\d+/.match(sess)
if pid
puts "killing #{pid}"
open "| screen -X -S #{pid} kill"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment