britodfbr

download-recursivo.sh

Aug 28th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/bin/bash
  2. for i in `lynx --source $1 |grep href | cut -d'>' -f2 | cut -d'<' -f1`; do
  3.    echo $1/$i;
  4.    mkdir $i;
  5.    cd $i;
  6.    for a in `lynx --source "$1/$i" |grep href | sed 's/.*a href="\(.*\)" rel=.*/\1/'`; do
  7.         echo "Baixando $1/$i/$a ..."
  8.         wget -A "gz,zip" -c "$1/$i/$a"
  9.    done
  10.    cd ..
  11. done
Add Comment
Please, Sign In to add comment