Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby -w
- io = open("|R --vanilla --quiet", "w+")
- at_exit { %x{rm -f /tmp/testpipe} }
- while true
- %x{ rm -f /tmp/testpipe && mkfifo /tmp/testpipe }
- input = File.read("/tmp/testpipe")
- io << input
- if input =~ /^q\(\)\s*$/ then
- %x{ rm -f /tmp/testpipe }
- exit
- end
- while line = io.gets
- print line
- end
- end
Add Comment
Please, Sign In to add comment