#! /usr/local/bin/perl -s # ----------------------------------------------------------- # 指定されたディレクトリ以下のファイルを random に # slide show 表示する --- ための sh script の生成 # ----------------------------------------------------------- $usage = <\" -geom +0+0 "; $delay = 5; $delay_buff = 1; $pics_max = 100; $mode_verb = 'yes'; if ( $h =~ /./ || $#ARGV < 0) { &usage; exit 2; } if ( $r =~ /./) { $mode_random = 'yes'; } #$aaa = join(" ", @ARGV ); foreach $DIR ( @ARGV ) { if ( -d $DIR && open(I,"find $DIR -type f 2>/dev/null |")) { while() { next if (/\/\./); s/[ \t\r\n]*$//; if(!/\/\./) { push(@files,$_); $filesn++; $filesnn++; if(100 <= $filesnn) { &mesg("$filesn files found."); $filesnn = 0; } } } } elsif(-f $DIR) { push(@files, $DIR); $filesn++; $filesnn++; if(100 <= $filesnn) { &mesg("$filesn files found."); $filesnn = 0; } } } &mesg("$filesn files."); @files_org = grep(/\.([Gg][Ii][Ff]|[Pp][Nn][Gg]|[Jj][Pp][Ee]?[Gg])$/,@files); while ( true ) { print < /dev/null 2>&1 EOB $ia = 0; undef $fileb; } } last if ($l !~ /./); } exit; sub mesg { local($msg) = @_; if($mode_verb =~ /./) { print STDERR "\r$msg"; } } sub randomize { local(@t) = @_; local(@r, $a, $n); local($seed) = $$ + time; while($a = pop(@t)) { srand($seed); $seed += 5; $n = int(rand(999999)); push(@u,"$n $a"); } @u = sort @u; undef @t; while($a = pop(@u)) { $a =~ s/^[0-9]* *//; push(@t, $a); } return @t; } sub usage { print $usage; }