In linux, complete the following shell script snippet, to ensure on_exit function is run whenever the SIGINT signal is sent (i.e. when user presses ctr-c):
#!/bin/sh
function on_exit ()
{
echo 'Bye bye'
}
[...]
sleep 500
trap on_exit SIGINT
^^ note the use of trap built-in command to bind the signal SIGINT to function on_exit
^^^ note the order of command line arguments given to trap, i.e. the binding functon is given first, then the signal
In linux, complete the following shell script snippet, to ensure on_exit function is run whenever the SIGINT signal is sent (i.e. when user presses ctr-c):
#!/bin/sh
function on_exit ()
{
echo 'Bye bye'
}
[...]
sleep 500
In linux, complete the following shell script snippet, to ensure on_exit function is run whenever the SIGINT signal is sent (i.e. when user presses ctr-c):
#!/bin/sh
function on_exit ()
{
echo 'Bye bye'
}
[...]
sleep 500
trap on_exit SIGINT
^^ note the use of trap built-in command to bind the signal SIGINT to function on_exit
^^^ note the order of command line arguments given to trap, i.e. the binding functon is given first, then the signal
status | not learned | measured difficulty | 37% [default] | last interval [days] | |||
---|---|---|---|---|---|---|---|
repetition number in this series | 0 | memorised on | scheduled repetition | ||||
scheduled repetition interval | last repetition or drill |