Advertisement
Guest User

parser.sh

a guest
Apr 23rd, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. descricao="^#"
  2. link="^http"
  3.  
  4. while read linha; do
  5.     [ "$linha" ] || continue # ignora linha se branca
  6.  
  7.     if [[ "$linha" =~ $descricao ]]; then
  8.         k=$linha
  9.     fi
  10.  
  11.     if [[ "$linha" =~ $link ]]; then
  12.         echo "<a href=\"$linha\"> $k </a></br>"
  13.     fi
  14.  
  15. done < paginas.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement