I want to know if anyone is trying to display the contents of the ruby program on stdin. I do not want the ruby to go back to allowing interactive input. How to do it?
ruby cat.rb
echo hello | ruby cat.rb
If I only cat.rbhave it puts gets, then the first example will block, waiting for EOF on the interactive stdin. I do not want to change the calling command, but I want to support both kinds of behavior.
Peter source
share