-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-n
executable file
·31 lines (29 loc) · 1.01 KB
/
generate-n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
if [ ! -e "./generate-n" ]
then
echo "Please run this script from the exec directory"
exit 1
fi
if [ $# == 0 ] || [ $1 == "-help" ]
then
echo "Generator options: ./generate-n <number of versions> ?<init number of products> ?<products step> ?<products variability>"
fi
# check that $1 is a integer
if ! [[ $1 =~ ^[0-9]+$ ]]
then
echo "Please provide an integer as the first argument"
exit 1
fi
number_of_versions=$1
products_number=${2:-100}
products_step=${3:-1000}
products_variability=${4:-1}
echo "Generating $number_of_versions versions"
echo "Setting products to $products_number, products step to $products_step and variability to $products_variability"
# loop through the number of versions and call ./generate
for i in $(seq 1 $number_of_versions)
do
echo "Generating version $i"
echo "Generating $((products_number + i * products_step)) products"
./generate -s ttl -pc $((products_number + i * products_step)) -tc $((i * products_step)) -ppt $((i * products_variability)) -fn "dataset-$i"
done