[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Looping a script



On Sun, 18 Feb 2001, Ashley M. Kirchner wrote:

> 
> a) If I do 'ls -AQU *.mp3', the result is always sorted.
>    However, if I just do 'ls -AQU' it's not sorted.
> 


This little script should give you a randomized selection of
the MP3's.


-- cut --

#!/bin/bash

let m=32768 n=0

while:
do
    set *.mp3
    shift $(( ($#*RANDOM) / (m+1) ))
    [ ${n%$#} ] && amp -p $1
    let n=$#
done

-- cut --



-- 
John Darrah (u05192)	| Dept: N/C Programming
Giddens Industries	| Ph: (425) 353-0405 #229
PO box 3190		| Ph: (206) 767-4212 #229
Everett  WA    98203	| Fx: (206) 764-9639








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]