I want to write a shell script that will read a file from standard input, remove all string and empty line character, and write the output to the standard output. the file look like this:
#some lines that do not contain <html> in here
<html>a<html>
<tr><html>b</html></tr>
#some lines that do not contain <html> in here
<html>c</html>
So, the output file should contain:
#some lines that do not contain <html> in here
a
<tr>b</html></tr>
#some lines that do not contain <html> in here
c</html>
I try to write this shell script:
read INPUT #read file from std input
tr -d '[:blank:]'
grep "<html>" | sed -r 's/<html>//g'
echo $INPUT
however this script isn't working at all. any idea? thx
<html></html>pairs in one document, as well...