#!/usr/bin/env bash #div block, find headers location then insert. Linux, academy, anime music ##
,
, id="ii", , id="x3" #sed -i -e '/

Linux/r $headOut' $output input=xyt2.md output=yt3.html headOut=ytTabsHead.txt #[ -f /etc/hosts ] && echo "Found" || echo "Not found" [[ -f $input && -f $headOut ]] || exit 1; [ -f $output ] && mv $output ."${output%%.*}"-old.html; # $input to html $output sed -i 's/[[:blank:]]*$//' $input #remove trailing blank sed -i 's/$/ /' $input # add 2 trailing space markdown_py $input > $output; # to Tabs : << '@nouse' From:

games

...

... To: #grabs h2 content and put to array. Count total, make " >> $output @nouse tmpHead=/tmp/head.txt tmp=/tmp/out.txt trap "rm -f $tmpHead $tmp" 0 2 3 15 cat $input| grep '^##'|sed 's/## //' > $tmpHead mapfile -t titles < <(cat $tmpHead) # reverse the lines order mapfile -t t2 < <(tac $tmpHead) (echo "" >> $tmp && mv $tmp $output # sandwhich $output between $headOut sed -i -e "1 e head -n -2 $headOut" $output tail -2 $headOut >> $output exit 0;