A short one today. About ruby.
When writing some small scripts, sometimes I tend to user rather Ruby than bash, perl or anything else.
Those scripts have to return some information or errors. There’s actually a simple mechanism to output string to either STDOUT or STDERR.
$stdout.puts 'This is going to stdout.' $stderr.puts 'This is going to stderr.'
On the console, this ends up as expected:
$ script.rb > logfile 2> errfile