Hi, I'm trying to use a code that change the wallpaper automatically, but I obtain the next error:
Line 18: Unexpected EOF while looking for matching `` '
Line 25: sintax error: Unexpected End of File
I think the code line is:
cnt=`wc -l "$temp_bg_list" | cut -f1 -d " "`
But I really don't understand what is the problem, so, can you help me?
Thanks a lot
#!/bin/bash
#tomado de: www.djlosch.com
bg_path=/home/tamayo/wallpapers
extensions="jpg png gif jpeg JPG GIF PNG"
temp_bg_list=/tmp/bg_change_list
rm -f $temp_bg_list
for extension in $extensions
do
find $bg_path -iregex ".*.$extension" >> "$temp_bg_list"
done
cnt=`wc -l "$temp_bg_list" | cut -f1 -d " "`
all_bgs=`echo \ `expr $RANDOM % $cnt\``
selected_bg=`head -n$all_bgs "$temp_bg_list" | tail -n1`
logger "Changed desktop to: $selected_bg"
gconftool-2 -t string -s /desktop/gnome/background/picture_filename
"$selected_bg"
exit 0