I'm running an infinite while loop in bash that has a counting element to it.
while :
do
#stuff including counting
trap break int
done
This works as I would like for the most part. When I hit Ctrl+C, the loop stops, but the script continues. However, the loop stops in the middle of the loop which means that the final count is inaccurate.
Is there a way to make this loop break at the very end?
