Reverse `find`
Richard Mortier · February 05, 2025 · #tech #codeIn the last few days I discovered I needed to search back up the filesystem from $CWD
to find the first occurence of a file (specifically, a Justfile
but that’s by-the-by). Got bored of doing it by hand so wrote a bash
shell function; here ’tis:
…or, as a one-liner:
F=.bashrc; while ; do [ && break; D= /..; done;