From b4fb215cf428f1fd85c15d29c5d3b6cfcca2e039 Mon Sep 17 00:00:00 2001 From: Colin P. McCabe Date: Tue, 29 Nov 2022 13:07:19 -0800 Subject: [PATCH] Add ff --- ff | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) create mode 100755 ff diff --git a/ff b/ff new file mode 100755 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 -- 1.6.6.rc1.39.g9a42