fix not initialized variable

This commit is contained in:
vv01f 2019-09-18 20:20:30 +02:00
parent 3185474366
commit 674cb8933f
Signed by untrusted user who does not match committer: vv01f
GPG Key ID: 02625A16AC1D1FF6
1 changed files with 7 additions and 2 deletions

9
gen.sh
View File

@ -59,7 +59,7 @@ newdataentry () {
customdir=$(pwd)
fl=""
test $# -eq 0 && {
>&2 echo "determining entry based on data.xml.\n"
>&2 echo "determining issue number based on data.xml.\n"
lastentry=$(cat data.xml |grep -i "<schleuder id="|head -1|cut -d'"' -f2)
newentry=$(( $lastentry + 1 ))
} || {
@ -80,6 +80,11 @@ newdataentry () {
# custom teaser xml-text, default: none
#~ t)
#~ teaser) ;;
# custom fs for files
#~ p)
#~ pdffs) ;;
#~ e)
#~ epubfs) ;;
# help text
#~ h)
#~ help)
@ -111,7 +116,7 @@ newdataentry () {
} || { datetime=0; } # remaining arguments should be teaser xml-message.
}
echo "<schleuder id=\"$newentry\">"
test $datetime -eq 0 && {
test "${datetime}" = "" || test $datetime -eq 0 && {
#~ datetime=$(LANG=en_US.utf8 date -u +"%a %d %b %Y %H:%M") # manual copy of known entries
datetime=$(LANG=en_US.utf8 date -u -R |rev|cut -d":" -f2-|rev) # RFC-5322-Format without seconds and TZ
} || {