Why does it not work? Recursion fails post first iteration:
bash
#!/bin/bash
function download_from_dir() {
url=$1; shift;
web_full=$(curl --silent $url | grep -Po '(?<=href\=).[^>]*' | tr -d '"')
printf "\n"
for i in $web_full; do
if [[ "$i" == "*.mp4" || "$i" == "*.png" || $i == "*.jpg" ]]; then
echo "yes $i"
else
echo "not $i"
download_from_dir "${url}/${i}"
Comment too long. Click here to view the full text.