Hey Saurav,

Maybe try something like the following?

def run_scripts
  scripts = [path_to_script1, path_to_script2, ...]

  results = scripts.map { |cmd| system( cmd ) }

  if results.all?
    # output the "all scripts passed" html
  else
    # output the "uh-oh there was an error" html
  end
end

Two tricks here:
  1) the "system" method runs the command in cmd and returns true if the
command exited successfully, otherwise it returns false or nil
  2) the "all?" method is an array method that by default returns true
if all array elements are true ("true" in the ruby sense), otherwise it
returns false

So what happens is if any of the commands fail, the "all?" method
returns false and you can use that to know that there was an error

Hope this helps. Let us know how it goes...

-- 
Posted via http://www.ruby-forum.com/.