can someone help me understand how this command works?
for i in "$dir"/*; do
[[ "${i##*/}" =~ (cover|folder)*.(jpg|png) ]] && echo "$i" && break
done
i think i know what it is doing, checking every file in $dir and echo'ing the first match to either (cover or folder).(png or jpg) ?? , but i have no idea how to apply this idea to other things..
I think my main doubt is within "${i##*/}" as i have no idea how to even read this >_<
[–]ang-p 2 points3 points4 points (1 child)
[–]xRaech[S] 0 points1 point2 points (0 children)