I have a bash script that iterates over a list of links, curl\'s down an html page per link, greps for a particular string format (syntax is: CVE-####-####), removes the surroun
HTML files can contain carriage returns at the ends of lines, you need to filter those out.
curl -s "$link" | sed -n '/CVE-/s/<[^>]*>//gp' | tr -d '\r' | while read cve; do
Notice that there's no need to use grep
, you can use a regular expression filter in the sed
command. (You can also use the tr
command in sed
to remove characters, but doing this for \r
is cumbersome, so I piped to tr
instead).