Now spaces are pretty common in pic names like 789 56 36.jpg provided by some camera etc.
I could work more on my script but I decided that spaces in filenames are really stupid and will probably cause trouble in other settings too; so I made me a remove spaces from (jpg) pictures script:
rmspace.sh
Code: Select all
IFS="\n"
for file in *.jpg;
do
    mv "$file" "${file//[[:space:]]}"
done
chmod it to execute:
Code: Select all
chmod +x rmspace.shRun this in the directory where you have your jpg wallpapers like this:
Code: Select all
./rmspace.shNow all the spaces will be removed from you jpg picture names - and it sure beats renaming them one by one

(The name stays the same; only the spaces are gone)