In earlier recipes, we introduced the use of trap to catch signals, and the use of kill to send signals to processes. These will be explained further in this recipe, but here are three new native Bash variables:
- $$: Which returns the PID of the current script
- $?: Which returns the PID of the last job that was sent to the background
- $@ :Which returns the array of input variables (for example, $!, $2)