TODO: documentation needs work, so document it :P
[rainbows.git] / t / bin / utee
blob7b61fea9139c24a5adc423f8b706c8d6decb109f
1 #!/usr/bin/env ruby
2 # -*- encoding: binary -*-
3 # tee(1) as distributed on most(all?) systems is buffered in luserspace
4 # this only does unbuffered writes (with line-buffered input) to make
5 # test output appear in real-time
6 $stdin.binmode
7 $stdout.binmode
8 fp = File.open(ARGV.shift, "wb")
9 $stdin.each_line do |line|
10 fp.syswrite line
11 $stdout.syswrite line
12 end