Created
November 13, 2015 15:51
-
-
Save bascht/fbb57bcfff30098470ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| puts "Ohai, I am #{Process.pid()} and hungry for input!" | |
| puts "Got: #{$stdin.read}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| sleep 5 | |
| $stdout << "PENG!\n\r" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $> ./stdout.rb | ./stdin.rb & | |
| Ohai, I am 11531 and hungry for input! | |
| $> kill -9 11531 | |
| $> fish: Process 11531, “./stdin.rb” from job 1, “./stdout.rb | ./stdin.rb &” terminated by signal SIGKILL (Forced quit) | |
| Job 1, “./stdout.rb | ./stdin.rb &” has ended |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment