I have a very simple question. I have a program that accepts an integer number as input (followed by a CR). I want to run this program a number of times, and I want this integer number to be a different (random) number each time. So I want to wrap everything in a shell script, but I don’t really know how to implement it. I am thinking something along the lines of the following code, but the 12345 replaced by $RANDOM. How should I do it?
Thanks a bunch in advance,
S.
#!/bin/bash
i=1
while [ $i -le 100 ]
do
./recomb100runs << !!
12345
!!
done
You want to use
$((RANDOM)):(Replace “cat” with the script you want to run with the random input — in your case “
./recomb100runs“.)