. f_askfname.sh
. f_askstring.sh
ask_filename "Taget File( Blank is Cancel. ): " 1
if [ $? -ne 0 ]; then
echo "*** Canceled."
return 1
fi
FILE1=${_STR}
echo "Target File is \"${FILE1}\""
ask_string "Save File [${FILE1}.txt]: " 1
if [ $? -ne 0 ]; then
FILE2="${FILE1}.txt"
else
FILE2=${_STR}
fi
echo "Save File is \"${FILE2}\""
sed 's/<[^>]*>//g' ${FILE1} |
tr -d '[:blank:]' |
cat -s > ${FILE2}
echo "*** Successful."
unset FILE1 FILE2 _STR
$ ./html2txt.sh
Taget File( Blank is Cancel. ): 1.html
Target File is "1.html"
Save File [1.html.txt]:
Save File is "1.html.txt"
*** Successful.
$ cat 1.html.txt
あんみのの備忘録