sigusr1() { echo $1;}
trap sigusr1 SIGUSR1
I'm a bash newbie!
I have the above trap and signal code in my .bash_profile.To trigger sigusr1
, i simply call Kill -SIGUSR1 pid
in the terminal. I googled to find out how I can pass in a parameter into sigusr1
but I can't find anything except for if i use it as trap 'sigusr1 hello' SIGUSR1
But that defeat the purpose. I would like to pass in the parameter via the terminal. How can I pass in a parameter via the kill command so that sigusr1
function can echo it out?