htmlใใกใคใซใใtxtใใกใคใซใ็ๆใใๆนๆณใ่ฉฆใใฆใใใ
<ใใฎ้ ใฏๆธใใใใงใใ้ ๆฌก่ฟฝ่จใใพใใ>
Delete html tags using sed/grep/awk
https://unix.stackexchange.com/questions/359980/delete-html-tags-using-sed-grep-awk
rmtag.sed
sed -e 's/<[^>]*>//g' index.* > indexall.txt
ไธ่จใงใใพใใใใชใใฃใใฎใฏใ๏ผ่กใซใพใใใใฟใฐใ
ใใพใๅใใชใใฃใใ
ใใใชๆใใ
<section id="c188278" class="g-padding-top-5 g-padding-bottom-5
">
ๆน่กใๅใฃใฆใใๅฆ็ใใใฐใใพใใใใใใ
bashใงๅคๆฐๅ
ใฎๆน่กใณใผใใ้คๅปใใ
https://hacknote.jp/archives/12122/
ใทใงใซในใฏใชใใใงใฎๆน่กๆๅญใฎๅ้คใซใใใ
https://hacolab.hatenablog.com/entry/2019/07/29/235312
tr -d '\n' < infile > outfile
ใชใใจใใใพใใใใใใ
#!/bin/sh
# https://unix.stackexchange.com/questions/359980/delete-html-tags-using-sed-grep-awk
# https://hacolab.hatenablog.com/entry/2019/07/29/235312
# https://qiita.com/kaizen_nagoya/items/ad4f75b391ff95e72634
_LISPDIRS=`find . -maxdepth 1 -mindepth 1 -type d`
for _DIRS in ${_LISPDIRS}; do
echo -e "\n-- ${_DIRS} --"
cd $_DIRS
tr -d '\n' < index.* >> /tmp/web/indexall.txt
cd ../
done
sed -e 's/<[^>]*>//g' /tmp/web/indexall.txt > index.txt
ใใใงใฏใพใ ้ง็ฎใ ใฃใใ
ใใทใงใซในใฏใชใใใใใกใคใซใใใฃใฌใฏใใชใฎๆ็กใ็ขบ่ชใใๆนๆณ่ฒใ
https://www.server-memo.net/shellscript/file_check.html
# ./bat.sh
-e
-- ./www.xxx.com --
./bat.sh: 11: ./bat.sh: cannot open index.*: No such file
# ls
index.html
#!/bin/sh
# https://unix.stackexchange.com/questions/359980/delete-html-tags-using-sed-grep-awk
# https://hacolab.hatenablog.com/entry/2019/07/29/235312
# https://qiita.com/kaizen_nagoya/items/ad4f75b391ff95e72634
_LISPDIRS=`find . -maxdepth 1 -mindepth 1 -type d`
for _DIRS in ${_LISPDIRS}; do
echo -e "\n-- ${_DIRS} --"
cd $_DIRS
if [-e index.* ] then
tr -d '\n' < index.html >> /tmp/web/indexall.txt
fi
cd ../
done
sed -e 's/<[^>]*>//g' /tmp/web/indexall.txt > index.txt
# ./bat.sh
./bat.sh: 13: ./bat.sh: Syntax error: "fi" unexpected (expecting "then")
๏ผใใฎ่จไบใฏๅไบบใฎ้ๅปใฎ็ต้จใซๅบใฅใๅไบบใฎๆๆณใงใใ็พๅจๆๅฑใใ็ต็นใๆฅญๅใจใฏ้ขไฟใใใใพใใใ๏ผ
ๆๅพใพใงใใใฟใใใ ใใใใใจใใใใใพใใใ
ใใใญใ๐ใใใฉใญใผใใ้กใใใพใใ
Thank you very much for reading to the last sentence.
Please press the like icon ๐ใand follow me for your happy life.
'