Get PID of a function?

view full story

http://unix.stackexchange.com – #!/bin/bash function abc() # wait for some event to happen, can be terminated by other process { sleep 3333 } echo "PID: $$" abc & echo "PID: $$" I need to retrieve the pid of this function, but the echo prints the same string. If I'm not going to put abc() out of this script, is it possible to get it's pid and terminate that function? (HowTos)