Add ff
authorColin P. McCabe <cmccabe@apache.org>
Tue, 29 Nov 2022 21:07:19 +0000 (13:07 -0800)
committerColin P. McCabe <cmccabe@apache.org>
Tue, 29 Nov 2022 21:07:19 +0000 (13:07 -0800)
ff [new file with mode: 0755]

diff --git a/ff b/ff
new file mode 100755 (executable)
index 0000000..d4eddc7
--- /dev/null
+++ b/ff
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+#
+# find first
+#
+# Prints out the first file which matches the given pattern in the current directory subtree.
+#
+
+die() {
+    echo $@
+    exit 1
+}
+
+[[ $# == 1 ]] || die "You must specify exactly one argument"
+TOFIND=$1
+exec find . -name '*'${TOFIND}'*' -print -quit