View Single Post
Old 04-04-2014, 05:57 PM   #3
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by Eradicatore View Post
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
Different command processor.
The Kindle uses Busybox-ash.
(Hint: Ash does not do arrays, but Bash does.)

So run Busybox-ash on your Mac when testing scripts for the Kindles.
knc1 is offline   Reply With Quote