#!/usr/bin/perl print(<<'usage') and exit if (@ARGV[0] eq "--help"); parallel-run [--help | --test] [--] directory... version 0.1 (990803) jiri@baum.com.au Similar to run-parts, but runs everything simultaneously. Doesn't have as many options :-) usage #' #this line fixes vim syntax highlighting (vim doesn't grok here-docs) shift, $t=1 if @ARGV[0] eq "--test"; shift if @ARGV[0] eq "--"; for $d (@ARGV) { opendir D,$d or die "can't opendir $d: $!"; push @cmds, (grep {/\/[\w-]+$/ and -f and -x} (map "$d/$_",readdir D)); closedir D; } die "No commands to run!\n" unless scalar @cmds; print join("\n ",($0=~/([^\/]*)$/)[0]." would run:",@cmds)."\n"and exit if $t; for (@cmds) {fork or exec $_ or die "can't exec $_\n"} 1 until wait == -1;