From: Joseph Nuthalapati Date: Fri, 26 Feb 2021 14:59:56 +0000 (+0530) Subject: utils: Add run-seq X-Git-Url: https://njoseph.me/gitweb/babashka-scripts.git/commitdiff_plain/cd6a808b48af61f35ea08b9a4a4f225a9b490cd9 utils: Add run-seq Signed-off-by: Joseph Nuthalapati --- diff --git a/utils.clj b/utils.clj index 38b9b74..c3cdf5a 100644 --- a/utils.clj +++ b/utils.clj @@ -14,3 +14,16 @@ ["git" "pull" "--rebase"] ["git" "checkout" "-"] ["git" "rebase" "master"]]))))) + +(defn run-seq + "Run a sequence of shell commands on a sequence of arguments. + + Examples: + + 1. Play and delete each video from a folder + ls | bb -i '(run-seq ["mpv" "rm"] *input*)' + " + [commands arguments] + (doseq [argument arguments + command commands] + (println (run-cmd [command argument]))))