Uma maneira de fazer isso:
quit=n
trap 'quit=y' INT
progress() {
SPIN='-\|/'
# Run the base 64 code in the background
echo $THECOMMAND | base64 -d|bash &
pid=$! # Process Id of the previous running command
i=0
while kill -0 $pid 2>/dev/null
do
if [ x"$quit" = xy ]; then
kill $pid
break
fi
i=$(( (i+1) %4 ))
# Print the spinning icon so the user knows the command is running
printf "\r$COMMAND:${SPIN:$i:1}"
sleep .2
done
printf "\r"
}