From 079bee577486d7728481cc30f71c81f530fb1dcd Mon Sep 17 00:00:00 2001 From: dissimulo Date: Tue, 21 Apr 2026 10:01:08 -0700 Subject: [PATCH] spam-ascii: pass -L to find so it dereferences ~/ascii when symlinked ~/ascii is a symlink to ~/.yadr/ascii. Without -L, 'find ' treats the link itself as the starting point, -type f rules it out, and fuzzy matches return nothing. --- .local/bin/spam-ascii | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.local/bin/spam-ascii b/.local/bin/spam-ascii index 19b3067e..f4a11162 100755 --- a/.local/bin/spam-ascii +++ b/.local/bin/spam-ascii @@ -32,8 +32,10 @@ for candidate in \ fi done -# 3. First case-insensitive substring match. -match=$(find "$dir" -maxdepth 1 -type f -iname "*$pattern*" 2>/dev/null \ +# 3. First case-insensitive substring match. -L so find follows a possible +# symlink starting point (e.g. ~/ascii -> ~/.yadr/ascii); without it, find +# treats the symlink itself as the "starting point" and ignores -type f. +match=$(find -L "$dir" -maxdepth 1 -type f -iname "*$pattern*" 2>/dev/null \ | sort \ | head -n1)