From c68fcffccef9ddf63af598a76edecfa499ad8fa3 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Fri, 31 May 2024 23:12:49 -0600 Subject: Added: Script files for randomizing and compiling --- pdf-compile.sh | 3 +++ random-values.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 pdf-compile.sh create mode 100644 random-values.sh diff --git a/pdf-compile.sh b/pdf-compile.sh new file mode 100644 index 0000000..4fe9cab --- /dev/null +++ b/pdf-compile.sh @@ -0,0 +1,3 @@ +for i in {1..150}; do + pdflatex -jobname="$i" template.tex +done diff --git a/random-values.sh b/random-values.sh new file mode 100644 index 0000000..66ae9ab --- /dev/null +++ b/random-values.sh @@ -0,0 +1,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 -- cgit v1.2.3