From 0c5498e22cce3e4b2d3d4b3995fa868ceccb4a9e Mon Sep 17 00:00:00 2001 From: brmo Date: Thu, 2 Sep 2021 12:05:02 -0700 Subject: [PATCH] Added ability to write directly to out file. --- tinyhome | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tinyhome b/tinyhome index 1fab53a..a37b905 100755 --- a/tinyhome +++ b/tinyhome @@ -2,6 +2,7 @@ title=tinyhome configfile="${1:-config.csv}" +outfile="index.html" get_element(){ echo "${2}" | cut -d',' -f${1} | xargs @@ -14,16 +15,16 @@ itemize(){ icon="$(get_element '3' "${line}")" if [ "${category}" = 'heading' ]; then - echo "

${name}

" + echo "

${name}

" >> $outfile elif [ "${category}" = 'section' ]; then - echo "

${name}

" + echo "

${name}

" >> $outfile elif [ "${category}" = 'item' ]; then url="$(get_element '4-' "${line}")" - echo "${name}" + echo "${name}" >> $outfile fi } -cat << EOF +cat << EOF > $outfile ${title}