I have written below script:
#!/bin/bash
sleep 15
function_signalr()
{
date
date | awk '{printf "%-15s\n", $2}'
}
trap "function_signalr" 10
When I start the process by "process &" it runs, the PID is given. I do kill -10 PID, but my trap does not work. The process is killed, but the trap did not sprung. No date message is given. I will be grateful for any advice.