Created
January 14, 2015 19:08
-
-
Save Habmala/6ffbe092e2efe3850999 to your computer and use it in GitHub Desktop.
Adds some html to plaintext files. No error handeling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
### | |
#vad jag vill åstadkomma | |
#läs blogtexten | |
# | |
#byt ut [enter] mot <br> | |
# | |
#byt ut [enter enter] mot </p><p> | |
# | |
#skriv till ny fil (ifall det blir några problem) | |
### | |
sed ':a;N;$!ba;s/\n\n/<\/p><p>/g' < $1 > ./wipText1 | |
sed ':a;N;$!ba;s/\n/<br>\n/g' < ./wipText1 > ./wipText2 | |
sed 's/<\/p><p>/\n&\n/g' < ./wipText2 > ./procBlogText | |
#cat ./finishedText | |
rm ./wipText1 | |
rm ./wipText2 | |
#sed s/$/\<p\>\<p\>/ < $1 | |
#sed s/$/\<br\>/ < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment