How do I ignore the division by zero error in Bash?
Example 1: (Doesn't work)
echo $((1/0)); echo "yay";
echo $((1/0)) || echo "yay";
Example 2:
echo -n $(echo -n $((1/0))) 2> /dev/null; echo "yay";
Is there an easier way than example 2, that would default to a specific value, when a division by zero is encountered.