makeLeft and makeNewline put into include
This commit is contained in:
parent
da8dcc7222
commit
822d58734c
@ -39,5 +39,17 @@ function italicLetters() {
|
||||
printf "\x1b\x34" >> "$1"
|
||||
}
|
||||
|
||||
function makeNewline() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf "\n" >> "$2"
|
||||
done
|
||||
}
|
||||
|
||||
function makeLeft() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf " " >> "$2"
|
||||
done
|
||||
}
|
||||
|
||||
init
|
||||
resetLetters $DEVICE
|
||||
|
@ -8,18 +8,6 @@ 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."
|
||||
@ -30,20 +18,20 @@ fi
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP
|
||||
makeLeft
|
||||
makeNewline $TOP $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$GIVENNAME" >> $FILE
|
||||
|
||||
makeNewline 4
|
||||
makeLeft
|
||||
makeNewline 4 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$SURNAME" >> $FILE
|
||||
|
||||
makeNewline 3
|
||||
makeLeft
|
||||
makeNewline 3 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$HOME" >> $FILE
|
||||
|
||||
makeNewline 4
|
||||
makeLeft
|
||||
makeNewline 4 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
|
42
jhp/gpgkey
42
jhp/gpgkey
@ -45,18 +45,6 @@ function moveDown() {
|
||||
done
|
||||
}
|
||||
|
||||
function makeNewline() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
function makeLeft() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf " " >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
@ -69,11 +57,11 @@ function heading() {
|
||||
fi
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
fi
|
||||
|
||||
makeLeft $LEFT
|
||||
makeLeft $SPACE
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $SPACE $FILE
|
||||
|
||||
bigLetters $FILE
|
||||
printf "GPG" >> $FILE
|
||||
@ -90,10 +78,10 @@ function insertFP() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
@ -101,10 +89,10 @@ function insertFP() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
@ -114,8 +102,8 @@ function insertFP() {
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
@ -123,10 +111,10 @@ function insertFP() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
@ -138,7 +126,7 @@ function insertFP() {
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertFP $@
|
||||
|
||||
|
36
jhp/iro
36
jhp/iro
@ -47,18 +47,6 @@ function moveDown() {
|
||||
done
|
||||
}
|
||||
|
||||
function makeNewline() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
function makeLeft() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf " " >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
@ -76,29 +64,29 @@ function heading() {
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
fi
|
||||
makeLeft 1
|
||||
makeLeft $SPACE
|
||||
makeLeft 1 $FILE
|
||||
makeLeft $SPACE $FILE
|
||||
italicLetters $FILE
|
||||
printf "INTERGALACTIC\n" >> $FILE
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
fi
|
||||
makeLeft 1
|
||||
makeLeft $SPACE
|
||||
makeLeft 1 $FILE
|
||||
makeLeft $SPACE $FILE
|
||||
printf "REGISTRATION\n" >> $FILE
|
||||
bigLetters $FILE
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
if [ $(($FIELD % 2)) -eq 1 ]; then
|
||||
makeLeft $(($HSPACE - 1))
|
||||
makeLeft $(($HSPACE - 1)) $FILE
|
||||
fi
|
||||
else
|
||||
if [ $(($FIELD % 2)) -eq 0 ]; then
|
||||
makeLeft 1
|
||||
makeLeft 1 $FILE
|
||||
fi
|
||||
makeLeft $HSPACE
|
||||
makeLeft $HSPACE $FILE
|
||||
fi
|
||||
printf "OFFICE\n" >> $FILE
|
||||
resetLetters $FILE
|
||||
@ -114,10 +102,10 @@ function insertDate() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGESMALL
|
||||
makeLeft $NEXTPAGESMALL $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
@ -129,7 +117,7 @@ function insertDate() {
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertDate
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user