unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob 7b61fea9139c24a5adc423f8b706c8d6decb109f 361 bytes (raw)
$ git show v0.97.1:t/bin/utee	# shows this blob on the CLI

 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

git clone https://yhbt.net/unicorn.git