Answers for "bash catch ctrl-c"

0

bash catch ctrl-c in a script

#!/bin/bash

function finish() {
        echo "bye bye!"
}

trap finish SIGINT

for number in $(seq 10); do
        echo "TODO: Insert work here..."
        # Insert work to do here.
done
Posted by: Guest on May-03-2021

Code answers related to "BASIC"

Browse Popular Code Answers by Language