diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:56 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:56 -0700 |
commit | 95417ca711a75612da86a25acd20134efdbc0e67 (patch) | |
tree | 653f9486283cc2ff2c8abc5835291ed05652c4c6 /t/bin | |
parent | b68b53c0323f691dbc412fa5ff581ff0b9a7ef1f (diff) | |
download | rainbows-95417ca711a75612da86a25acd20134efdbc0e67.tar.gz |
Buffering enabled in tee(1) was making tests more difficult to debug.
Diffstat (limited to 't/bin')
-rwxr-xr-x | t/bin/utee | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/bin/utee b/t/bin/utee new file mode 100755 index 0000000..e48f307 --- /dev/null +++ b/t/bin/utee @@ -0,0 +1,12 @@ +#!/usr/bin/env ruby +# 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 +# -*- encoding: binary -*- +$stdin.binmode +$stdout.binmode +fp = File.open(ARGV.shift, "wb") +$stdin.each_line do |line| + fp.syswrite line + $stdout.syswrite line +end |