Run linux command in ruby -
i'm trying following..
if "ps | grep -e file" true; else false; what need make string n if statement execute linux command listed?
simply use system("command"). it'll return true if command executed.
edit read question again, , believe you're looking this:
if `ps | grep -e file`.empty? # no matches true else false end
Comments
Post a Comment