I tried to have an interactive program in a bash script :
my_program
And I wish to be able to close it with 'Ctrl + c'. But when I do it my script is closing as well.
I know about.
trap '' 2
my_program
trap 2
But in this case, I just can't close my_program
with Ctrl + c.
Do you have any idea how to allow Ctrl + c on a program, but not closing the script running it ?
EDIT : add example
#!/bin/bash
my_program
my_program2
If i use Ctrl + c to close my_program
, my_program2
is never executed because the whole script is exited.
tail
s instead of killing cats next time? – kubanczyk Sep 11 '18 at 07:13