Well, does anyone know how to create this script request in the image below? I'm doing some exercises with the theme, and this medium that got me.
Try this:
#!/bin/bash
# make_page -Sua Página
cat <<- _EOF_
<html>
<head>
<title>
Minha Lista
</title>
</head>
<body>
<span>Itens:</span>"
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
<li>item 5</li>
</ul>
</body>
</html>
_EOF_
Assuming the html code is in file.html
,
grep -Po '<li>\K.*(?=</li>)' file.html
An option with thirst:
sed -n '/item/p' file.html | sed -e 's/<[^>]*>//g'