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

Re: shuffle руками



On Fri, Mar 23, 2001 at 03:09:41PM +0100, Artem Baguinski wrote:
> возвращаясь к моему скрипту, который играл мпеги в случайном порядке
> 
> find $DIR -follow -name "*.mp3" | mpg123 -@ - -Z -q
> 
> к сожалению mpg321 не умеет списки, а значит и порядок случайный. такой метод:
> 
> find $DIR -follow -name "*.mp3" -exec mpg321 -q \{} \;
> 
> не очень хорош, потому что файлы играются по порядку, чего я не хочу. вопрос: а как бы мне вывод find перемешать хорошенько?
> 
> спасибо.
> 

find . -follow -name "*.mp3" |perl -e '@$l=<>;for($i=@$l;--$i;){$j=int rand($i+1); next if $i==$j;@$l[$i,$j]=@$l[$j,$i];};print @$l;'|xargs mpg321 -q



> --  
> To UNSUBSCRIBE, email to debian-russian-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 

-- 
dg

============================================================================
This message is for informational purposes only and may contain confidential
business information. All data and other information in it are not warranted
as to completeness or accuracy. Any statements made herein do not necessarily
reflect those of WARP Solutions Inc. It is intended for the addressee only
and may not be copied without our permission. If you are not the intended
recipient please contact the sender as soon as possible
============================================================================



Reply to: