prl --cmd "zip -r '{ls .}.zip' '{ls .}'"
prl --dry-run --cmd "zip -r '{ls .}.zip' '{ls .}'"
prl -s --cmd "zip -r '{ls .}.zip' '{ls .}'"
prl -s --progbar-string "Zipping files.." --cmd "zip -r '{ls .}.zip' '{ls .}'"
prl -j 6 --cmd "du -h '{ ls ~/Downloads/*.zip | grep pdf }'"
# don't forget the the two quotes(') around the command - that way spaces etc in filenames are correctly handled
prl -s -j 12 --cmd "ping -c 1 192.168.0.{seq 0 100} && echo 192.168.0.{seq 0 100} UP >> hosts.txt || echo 192.168.0.{seq 0 100} DOWN >> hosts.txt" --progbar-string "Pinging hosts.."
- -j -> The number of concurrent processes to execute the command over
- --cmd -> A string of the command to execute.
- --progbar-string -> Set custom text for your progress bar
- -s -> Silent mode, don't print text returned from commands to stdout(but still show progbar)
- --dry-run -> Print out generated commands to be executed, but don't actually execute them
- --help -> Print help msg
The command string should have commands to parallelize over in parantheses -> {} The results of this command should result in a list of arguments, separated by newline(\n) prl will execute the supplied command in parallel, substituting the arguments into the place of the parantheses
prl -j 2 -cmd "ls '{ls /home}'"
Where /home contains:
/home/user1
/home/user2
The commands executed concurrently will be:
ls '/home/user1'
ls '/home/user2'
But this can be used for any shell command.
- Better logging, where all the output is captured and sorted by command
- Many, many more tests