I am writing a shell script on my Linux machine, and I'm trying to figure out a good way to write a function that I could call that would set a variable, let's call it $variable, to a random number between 1 and 466,550. Of course I could write;
shuf -i 1-466550 -n 1
And it'll do the trick, but how could I write this in a function to have it set my variable, $variable, to that random number (until the function is called again, at which case it picks another random integer from 1-466,550)?