c3Reg/jhp/JunghackerPass
2020-06-01 17:46:56 +02:00

56 lines
756 B
Bash
Executable File

#!/bin/bash
FILE=/tmp/$RANDOM
TOP=7
LEFT=2
MAXLENGTH=25
GIVENNAME=$1
SURNAME=$2
HOME=$3
function makeNewline() {
for((i=0; i<$1; i++)); do
printf "\n" >> $FILE
done
}
function makeLeft() {
for((i=0; i<$LEFT; i++)); do
printf " " >> $FILE
done
}
if [ ${#GIVENNAME} -gt $MAXLENGTH ] || [ ${#SURNAME} -gt $MAXLENGTH ] || [ ${#HOME} -gt $MAXLENGTH ]; then
echo "MAXLENGTH EXCEEDED."
exit 1
fi
source ../include/nixdorf
init
makeNewline $TOP
makeLeft
printf "$GIVENNAME" >> $FILE
makeNewline 4
makeLeft
printf "$SURNAME" >> $FILE
makeNewline 3
makeLeft
printf "$HOME" >> $FILE
makeNewline 4
makeLeft
if [ -n "$EVENT" ]; then
printf "$EVENT, $(date -I)" >> $FILE
else
printf "$(date -I)" >> $FILE
fi
printFile $FILE
rm $FILE