Recent Posts
Recent Comments
Resistance things (나무위키 퍼가기 금지)
sed를 이용하여 각 단어 양쪽에 태그 달기 본문
728x90
bash의 sed를 이용하여 각 단어에 html 등의 태그를 다음과 같이 달 수 있다.
예) 단어1 단어2 단어3 -> <p>단어1</p> <p>단어2</p> <p>단어3</p>
cat INPUT | sed -e 's/ /<\/p> <p>/g' -e 's/^/<p>/g' -e 's/$/<\/p>/g' -e 's/^<p><\/p>$//g' > OUTPUT
Comments