Created
August 3, 2019 10:05
-
-
Save hacolab/08def4a39a608836d550695f650dd7e5 to your computer and use it in GitHub Desktop.
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/sh | |
# Line fiead symbol | |
LF_CHAR=">" | |
#[INPUT] | |
# <entry> | |
# <tag>value1</tag> | |
# </entry> | |
# <entry> | |
# <tag>value2</tag> | |
# </entry> | |
# | |
#[OUTPUT] | |
# <entry><tag>value1</tag></entry> | |
# <entry><tag>value2</tag></entry> | |
tr '>' '<' \ | |
| sed "s#</entry<#$LF_CHAR#g" \ | |
| tr -d '\n' \ | |
| tr "$LF_CHAR" '\n' \ | |
| sed 's#<\([^<]*\)<#<\1>#g' \ | |
| sed 's#$#</entry>#' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment