Guest User

Untitled

a guest
Feb 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/usr/bin/env ruby -w
  2.  
  3. io = open("|R --vanilla --quiet", "w+")
  4.  
  5. at_exit { %x{rm -f /tmp/testpipe} }
  6. while true
  7. %x{ rm -f /tmp/testpipe && mkfifo /tmp/testpipe }
  8. input = File.read("/tmp/testpipe")
  9. io << input
  10. if input =~ /^q\(\)\s*$/ then
  11. %x{ rm -f /tmp/testpipe }
  12. exit
  13. end
  14. while line = io.gets
  15. print line
  16. end
  17. end
Add Comment
Please, Sign In to add comment