From a5b5040ff31b96a0ba521865322a9813b1c53264 Mon Sep 17 00:00:00 2001 From: Vanessa McHale Date: Wed, 4 Jan 2023 08:48:33 -0500 Subject: [PATCH] fun example program --- examples/fdupes.jac | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/fdupes.jac diff --git a/examples/fdupes.jac b/examples/fdupes.jac new file mode 100644 index 00000000..bac4ba07 --- /dev/null +++ b/examples/fdupes.jac @@ -0,0 +1,10 @@ +{. invoke like so: +{. fd . -t f -x md5sum | sort | ja run fdupes.jac +{. inspired by Yann Le Du: https://twitter.com/Yann_Le_Du/status/1610299070819729410 + +fn step(acc, this) := + if (substr this 0 32) = (substr (acc->1) 0 32) + then (this . Some (this + '\n' + acc->1)) + else (this . None); + +(->2):?step^(''.None) $0