made a few tweaks to make the script behave better:
- turned on
shopt -s nullglobso the loop skips*.mediawikiwhen there are no files. - put quotes around
$fnameingrepso filenames with spaces don’t break things. - switched
if [ "$GRES" != "" ]toif [ -n "$GRES" ]— just cleaner and more reliable.