Thread
:
shell script to randomize files in directory
View Single Post
04-04-2014, 02:39 PM
#
2
Eradicatore
i void warranties
Posts: 22
Karma: 1038
Join Date: Apr 2014
Location: Wisconsin
Device: Kindle PW2
Here was my script that worked on my Mac, but not the kindle:
#!/bin/sh
FILES=(*.png)
while true
do
n=${#FILES[@]}
f="${FILES[RANDOM % n]}"
while [ "$f" = "$last" ]
do
f="${FILES[RANDOM % n]}"
done
last=$f
echo "WALLPAPER: $f"
sleep 2
done
Eradicatore
View Public Profile
Find More Posts by Eradicatore
Track Posts by Eradicatore via RSS