Created
May 23, 2011 23:46
-
-
Save tc/987882 to your computer and use it in GitHub Desktop.
helper functions for managing processes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# helper functions for managing processes | |
def run_system_command(cmd) | |
puts cmd | |
status = system(cmd) | |
$?.exitstatus | |
end | |
def kill_matching_process_cmd(process_name) | |
cmd = "echo `ps -ef | grep -v grep | grep \"#{process_name.gsub("-", "\\-")}\" | awk '{print $2}'` | xargs kill" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment