I want to use bash script to generate some files. The file names will be in the format 2_x.yRandom.txt, where x is 2, 4, 6, 8, 10 and y is from 1 to 5. eg. "2_2.2Random.txt" or "2_4.3Random.txt"
This is my script:
#Generate input for sort1
for i in 2 4 6 8 10
do
for j in 1 2 3 4 5
do
java utils.StringGenerator r 2 $i > "2_$i.$jRandom.txt"
java utils.StringGenerator s 2 $i > "2_$i.$jSorted.txt
java utils.StringGenerator v 2 $i > "2_$i.$jReversed.txt
done
done
The output file is always 2_2..txt or 2_4..txt, it seems that $j is not in the output.
What am I doing wrong?
Thanks! PS: I'm using a Mac.