diff --git a/html_md.sh b/html_md.sh index 929568cbee64cfdf65a461be7370ad977aebdba6..93526f9f62a430dab11027c5cc9ef33b3d28dbaa 100755 --- a/html_md.sh +++ b/html_md.sh @@ -31,7 +31,7 @@ if [ "$1" = "-w" ]; then # test exists file -> yes - kill process wget - until test -f $FILE + until test -f "$FILE" do if [ ! -f "$FILE" ]; then echo "Download..." @@ -40,7 +40,7 @@ if [ "$1" = "-w" ]; then done echo "Download complete..." - kill $pid + kill "$pid" find . -name "@@s*" | while read i; @@ -82,7 +82,7 @@ if [ "$1" = "-c" ]; then do # filtering html echo "$i"; - echo "\t\tfiltering html files..."; + printf "\t\tfiltering html files...\n"; HEAD=$(cat "$i" | grep -n -m1 '<h1' |cut -f1 -d: | tr --delete '\n') END=$(cat "$i" | grep -n -m1 '<!-- <div tal:content=' |cut -f1 -d: | tr --delete '\n') @@ -92,7 +92,7 @@ if [ "$1" = "-c" ]; then cat "$i" | sed '1,'"$((HEAD-1))"'d' | sed -n -e :a -e '1,'"$DOWN"'!{P;N;D;};N;ba' > "${i%.*}TMP.html" # converted .html to .md - echo "\t\t.html -> .md" + printf "\t\t.html -> .md\n" pandoc -f html -t markdown+pipe_tables-grid_tables "${i%.*}TMP.html" -o "${i%.*}.md"; rm "${i%.*}TMP.html"; @@ -113,7 +113,7 @@ if [ "$1" = "-c" ]; then done # text filtering of html, css, ... - echo "\t\tautomatic filter..." + printf "\t\tautomatic filter...\n" cat filter_auto | while read y; do @@ -122,7 +122,7 @@ if [ "$1" = "-c" ]; then cat "${i%.*}TMP.md" > "${i%.*}.md"; done - #echo "\t\tother filter..." + printf "\t\tother filter...\n" cat filter_other | while read a; do @@ -137,4 +137,4 @@ if [ "$1" = "-c" ]; then done rm filter_autoTMP rm filter_auto -fi +fi \ No newline at end of file