summaryrefslogtreecommitdiff
path: root/random-values.sh
blob: af4f6e0b0ff5a37f2fa56a75b7170ccf7eac24d0 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
for i in {1..150}; do
	AGE=$(shuf -i 20-40 -n 1)
	HEARTRATE=$(shuf -i 60-100 -n 1)
	BREATHRATE=$(shuf -i 12-20 -n 1)
	TENSIONSISTOLICA=$(shuf -i 120-139 -n 1)
	TEENSIONDIASTOLICA=$(shuf -i 80-89 -n 1)
	NAMENUMBER=$(shuf -i 1-100 -n 1)
	HEIGHTCENTIMETERS=$(shuf -i 165-185 -n 1)
	if (("$HEIGHTCENTIMETERS" >= 165 && "$HEIGHTCENTIMETERS" <= 180)); then
		WEIGHTNUMBER=$(shuf -i 1-11 -n 1)
	else
		WEIGHTNUMBER=$(shuf -i 11-26 -n 1)
	fi
	WEIGHT=$(sed -n "$WEIGHTNUMBER"p weight-list.txt)
	NAME=$(sed -n "$NAMENUMBER"p name-list.txt)
	FIRSTAPELLIDONUM=$(shuf -i 1-100 -n 1)
	SECONDAPELLIDONUM=$(shuf -i 1-100 -n 1)
	FIRSTAPELLIDO=$(sed -n "$FIRSTAPELLIDONUM"p apellidos-list.txt)
	SECONDAPELLIDO=$(sed -n "$SECONDAPELLIDONUM"p apellidos-list.txt)
	if (("$NAMENUMBER" >= 1 && "$NAMENUMBER" <= 59)); then
		ASAB="Masculino"
	else
		ASAB="Femenino"
	fi
	if (("$AGE" >= 20 && "$AGE" <= 28));then
		UNDERGRADNUM=$(shuf -i 0-1 -n 1)
	else
		UNDERGRADNUM=0
	fi
	[ "$UNDERGRADNUM" == 1 ] && UNDERGRAD="Si"
	[ "$UNDERGRADNUM" == 0 ] && UNDERGRAD="No"
	[ "$UNDERGRAD" == "Si" ] && CAREERNUMBER=$(shuf -i 1-17 -n 1) && CAREER=$(sed -n "$CAREERNUMBER"p career-list.txt)
	[ "$UNDERGRAD" == "No" ] && CAREERNUMBER=$(shuf -i 1-56 -n 1) && CAREER=$(sed -n "$CAREERNUMBER"p job-list.txt)
	EXERCISEHOEURS=$(shuf -i 2-12 -n 1)
	[ "$CAREER" == "Medicina" ] || [ "$CAREER" == "Enfermería" ] || [ "$CAREER" == "Médico" ] || [ "$CAREER" == "Profesional en ciencias del deporte" ] && EXERCISEHOEURS=$(shuf -i 7-14 -n 1)

	echo "\\def\\age{$AGE}
	\\def\\asab{$ASAB}
	\\def\\weight{$WEIGHT kg}
	\\def\\talla{$HEIGHTCENTIMETERS cm}
	\\def\\undergrad{$UNDERGRAD}
	\\def\\career{$CAREER}
	\\def\\horasejercicio{$EXERCISEHOEURS horas}
	\\def\\heartrate{$HEARTRATE}
	\\def\\breathrate{$BREATHRATE}
	\\def\\presion{$TENSIONSISTOLICA/$TEENSIONDIASTOLICA mmHg}
	\\def\\name{$NAME $FIRSTAPELLIDO $SECONDAPELLIDO}" > "$i".info
done