Answers for "wget files matching pattern"

1

wget files matching pattern

# Getting http://some/site/*my_pattern*
SITE="http://some/site/"
PATTERN="my_pattern"
wget -nv -O- $SITE | 
  grep $PATTERN | 
    awk -v pat=$PATTERN -F '"' '{ for (i=1; i<=NF; ++i) { if ($i ~ pat) print $i } }' |
      while read x; do 
      	if [[ ! $x = ">" ]] ; then
      	  wget $SITE$x &>/dev/null
      	  echo $x
      	fi
Posted by: Guest on May-03-2021

Code answers related to "wget files matching pattern"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language