c3Reg/stapleddipl/reg

53 lines
845 B
Plaintext
Raw Permalink Normal View History

2020-06-01 15:02:43 +00:00
#!/bin/bash
FILE=/tmp/$RANDOM
TOP=54
2020-06-11 15:54:10 +00:00
NEXTFIELD=5
LEFT=23
AUTHLEFT=66
DATELEFT=35
2020-06-11 15:54:10 +00:00
MAXLENGTH=17
2020-06-01 15:02:43 +00:00
GIVENNAME=$1
SURNAME=$2
HOME=$3
if [ ${#GIVENNAME} -gt $MAXLENGTH ] || [ ${#SURNAME} -gt $MAXLENGTH ] || [ ${#HOME} -gt $MAXLENGTH ]; then
echo "MAXLENGTH EXCEEDED."
exit 1
fi
source ../include/nixdorf
init
2020-06-11 15:54:10 +00:00
smallLetters $FILE
printf "\x1b\x33\x0e" >> $FILE
makeNewline $TOP $FILE
makeLeft $LEFT $FILE
2020-06-01 15:02:43 +00:00
printf "$GIVENNAME" >> $FILE
2020-06-11 15:54:10 +00:00
# Authority field
makeNewline 2 $FILE
makeLeft $AUTHLEFT $FILE
printf "C3Reg" >> $FILE
2020-06-11 15:54:10 +00:00
makeNewline 3 $FILE
makeLeft $LEFT $FILE
2020-06-01 15:02:43 +00:00
printf "$SURNAME" >> $FILE
2020-06-11 15:54:10 +00:00
makeNewline $NEXTFIELD $FILE
makeLeft $LEFT $FILE
2020-06-01 15:02:43 +00:00
printf "$HOME" >> $FILE
makeNewline 5 $FILE
2020-06-11 15:54:10 +00:00
makeLeft $DATELEFT $FILE
2020-06-01 15:02:43 +00:00
if [ -n "$EVENT" ]; then
2020-06-11 15:54:10 +00:00
printf "/ $EVENT, $(date -I)" >> $FILE
2020-06-01 15:02:43 +00:00
else
2020-06-11 15:54:10 +00:00
printf "/ $(date -I)" >> $FILE
2020-06-01 15:02:43 +00:00
fi
printFile $FILE
rm $FILE