fork download
  1. read n
  2. arr=()
  3. for ((i=0;i<n;i++))
  4. do
  5. read s
  6. array+=( $(echo "$s" | grep -o '<\s*[^>]\+>' | sed -r 's/< *\/?([^> \/]+)\/? *[^>]*>/\1/') )
  7. done
  8. echo "${array[@]}" | tr ' ' '\n' | sort -u | tr '\n' ';' | rev | cut -c 2- | rev
Success #stdin #stdout 0s 4464KB
stdin
2
<p><a href="http://w...content-available-to-author-only...t.com/html/tutorial/html_links.cfm">Example Link</a></p>
<div class="more-info"><a href="http://w...content-available-to-author-only...t.com/html/examples/html_links_examples.cfm">More Link Examples...</a></div>
stdout
a;div;p