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

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

asp.net mvc 3 - Unexpected "foreach" keyword after "@" character -