See: 1. https://en.cppreference.com/w/cpp/numeric/random 1. https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution Add a new, 2nd answer to this question in bash: https://stackoverflow.com/questions/1194882/how-to-generate-random-number-in-bash/71388666#71388666 Let your bash answer auto-compile the CLI tool on any Linux distro, and then use it in bash, for integer numbers only.