html shellscript table

1

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.

    
asked by anonymous 27.10.2016 / 01:14

3 answers

3

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_
    
27.10.2016 / 01:40
2

Assuming the html code is in file.html ,

grep -Po '<li>\K.*(?=</li>)' file.html
    
14.11.2016 / 17:00
1

An option with thirst:

sed -n '/item/p' file.html | sed -e 's/<[^>]*>//g'
    
11.10.2018 / 05:33