951dce1149564a168b969e0a4cb2307af1925b0f
[packages/precise/mcollective.git] / lib / mcollective / vendor / systemu / samples / b.rb
1 #
2 # quite a few keys can be passed to the command to alter it's behaviour.  if
3 # either stdout or stderr is supplied those objects should respond_to? '<<'
4 # and only status will be returned
5 #
6   require 'systemu'
7
8   date = %q( ruby -e"  t = Time.now; STDOUT.puts t; STDERR.puts t  " )
9
10   stdout, stderr = '', ''
11   status = systemu date, 'stdout' => stdout, 'stderr' => stderr
12   p [ status, stdout, stderr ]