[erlang-questions] beginner: How do I get a unix shell trap handler in escript?

Bengt Kleberg bengt.kleberg@REDACTED
Fri Jan 23 09:46:33 CET 2009


A unix shell(*) can trap signals. How do I do the same thing in escript?


(*) Example. Save the code below as script_name and start it with:
script_name 1 2 3 4
and then press ^C a few times.
#! /bin/sh

trap interrupt_handler INT

interrupt_handler () {
	echo interrupt_handler

for i in $* ; do
	echo $i
	sleep 10

More information about the erlang-questions mailing list