bash random number generator using shuf

This will generate a random number between -10 and 10. shuf doesn’t understand negative to positive range so run it through bc.

# echo "$(shuf -i 0-20| head -1)-10"|bc

Leave a Reply

Your email address will not be published. Required fields are marked *