Scripte zur Auswertung der von den Studierenden eingereichten git repositories
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
734 B

#!/bin/bash
if [ $# -eq 0 ]; then
echo "creates a *.tex file for the name and matrikel number given"
echo "and fetches the folder name of the latest checked out project."
echo "usage:"
echo " $0 Student Name from List MATRIKEL_NO"
exit 1
fi
_args=( "$@" )
MATRIKEL_NR=${_args[-1]}
unset _args[${#_args[@]}-1]
PROJECT_PATH=$(ls -1t ../../ProjektArbeiten/ | head -1)
NAME="${_args[@]}"
FILE_NAME=${NAME//[ ]/_}
FILE_NAME=bewertung-${FILE_NAME//[,]/}.tex
cp -v bewertung-student.tex $FILE_NAME
sed -i -e "s/StudentsName} {}/StudentsName} {$NAME}/" $FILE_NAME
sed -i -e "s/Matrikel}\( \)* {}/Matrikel}\1 {$MATRIKEL_NR}/" $FILE_NAME
sed -i -e "s/in_der_Praxis\//in_der_Praxis\/$PROJECT_PATH/" $FILE_NAME