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