Linuxmint 14 Cinnamon 32 bit
I'm trying to use this bash script with gnome-schedule but bash barfs on the line which begins with
DIR=. It's the folder on my
mounted Windows partition which contains hundreds of wallpaper images.
Code:
#!/bin/bash
# Script to randomly set Background from files in a directory
# Directory Containing Pictures
DIR='/mnt/XXXXX/Documents and Settings/All Users/Documents/My Pictures/Wallpaper'
# Command to Select a random jpg file from directory
# Delete the *.jpg to select any file but it may return a folder
PIC=$(ls $DIR/*.jpg | shuf -n1)
# Command to set Background Image
gconftool -t string -s /desktop/gnome/background/picture_filename $PIC
I've tried
Code:
DIR='/mnt/XXXXX/Documents and Settings/All Users/Documents/My Pictures/Wallpaper'
Code:
DIR='/mnt/XXXXX/Documents\ and\ Settings/All\ Users/Documents/My\ Pictures/Wallpaper'
Code:
DIR="/mnt/XXXXX/Documents and Settings/All Users/Documents/My Pictures/Wallpaper"
Code:
DIR="/mnt/XXXXXo/Documents\ and\ Settings/All\ Users/Documents/My\ Pictures/Wallpaper"
but bash can never handle the space characters. What's the secret? TNX.