60 lines
823 B
Plaintext
60 lines
823 B
Plaintext
|
#!/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 3
|
||
|
makeLeft
|
||
|
|
||
|
if [ -n "$EVENT" ]; then
|
||
|
printf "$EVENT, $(date -I)" >> $FILE
|
||
|
else
|
||
|
printf "$(date -I)" >> $FILE
|
||
|
fi
|
||
|
|
||
|
makeNewline 1
|
||
|
makeLeft
|
||
|
printf "Galactic Registr. Office" >> $FILE
|
||
|
|
||
|
printFile $FILE
|
||
|
rm $FILE
|