Is it possisble in bash script to use parameters in a function, which is called after interrupt signal? Here's my code:
inCaseOfInterrupt ()
{
while [ $# -gt 0 ]
do
echo "$1"
shift
done
exit 0
}
And in the other part of my script I have:
trap inCaseOfInterrupt 2
But it doesn't recognize my parameters. How can I use parameters in a function after script gets interrupt signal?