From cd6a808b48af61f35ea08b9a4a4f225a9b490cd9 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Fri, 26 Feb 2021 20:29:56 +0530 Subject: [PATCH] utils: Add run-seq Signed-off-by: Joseph Nuthalapati --- utils.clj | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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])))) -- 2.43.0