summaryrefslogtreecommitdiff
path: root/sample/trap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/trap.rb')
-rw-r--r--sample/trap.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/sample/trap.rb b/sample/trap.rb
new file mode 100644
index 0000000000..e552a0fddc
--- /dev/null
+++ b/sample/trap.rb
@@ -0,0 +1,3 @@
+trap('print("C-c handled\n")', 'INT', 'HUP')
+print("---\n")
+while gets(); print($_) end