Skip to content

Instantly share code, notes, and snippets.

@bascht
Created November 13, 2015 15:51
Show Gist options
  • Select an option

  • Save bascht/fbb57bcfff30098470ad to your computer and use it in GitHub Desktop.

Select an option

Save bascht/fbb57bcfff30098470ad to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
puts "Ohai, I am #{Process.pid()} and hungry for input!"
puts "Got: #{$stdin.read}"
#!/usr/bin/env ruby
sleep 5
$stdout << "PENG!\n\r"
$> ./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