Skip to content

Instantly share code, notes, and snippets.

@wearefriday
Created August 23, 2012 21:04
Show Gist options
  • Save wearefriday/3441714 to your computer and use it in GitHub Desktop.
Save wearefriday/3441714 to your computer and use it in GitHub Desktop.
craig@zuu 1 ruby-1.9.3-p194 ~$ cat ./example.rb
STDOUT.puts "STDOUT"
STDERR.puts "STDERR"
craig@zuu 0 ruby-1.9.3-p194 ~$ ruby ./example.rb 2>&1 1>example.out
STDERR
craig@zuu 0 ruby-1.9.3-p194 ~$ cat example.out
STDOUT
@getify
Copy link

getify commented Aug 23, 2012

why is that happening? i don't get it.

if you reverse the params order, does it fix it?

ruby ./example.rb 1>example.out 2>&1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment