#!perl #$begin="zmb1"; #$end = "zmb9"; $begin="zms1"; $end = "zxx9"; $| = 1; # from shufexh.perl sub nchoose { # "alphabet" local($al) = @_; local($i,$ti,$ta,@ret); return $al if(length($al)==1); for $i ($[..length($al)-1+$[) { $ti = substr($al,$i,1); $ta = $al; substr($ta,$i,1) = ""; for $out (&nchoose($ta)) { push(@ret,$ti.$out); } } @ret; } #$maxset = "123456"; $maxset = "123"; @allvals = &nchoose($maxset); %hit=(); for $i (1..length($maxset)) { foreach $thisord (@allvals) { $hitting = substr($thisord,$[,$i); next if(defined($hit{$hitting})); print "Samping: ",$hitting,"\n"; $hit{$hitting} = 1; @mids=(); for $ii ($[..length($hitting)-1+$[) { $ti = substr($hitting,$ii,1); push(@mids,"zxx$ti"); } &do_one("cat ".$begin." ".join(" ",@mids)." ".$end."| uudecode"); } } sub do_one { local($line)=@_; print $line,"\n"; system($line) && die "system line: $?"; # system("$ENV{HOME}/charon/cpm/uncrunch zmaxb01.lzr") && warn "system uncrunch: $?"; system("$ENV{HOME}/charon/cpm/uncrunch zmaxs01.lzr") && warn "system uncrunch: $?"; }