From 3806e4ee48ece7f02e7c730ee49d4f830afd165b Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Thu, 6 Nov 2025 16:32:49 +0100 Subject: optimized things xoxo --- printpath | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'printpath') diff --git a/printpath b/printpath index 3c59e8f..1a1a605 100755 --- a/printpath +++ b/printpath @@ -1,10 +1,6 @@ #!/bin/sh -# This script is slow, but it works -IFS=: -for dir in $PATH; do - [ -d "$dir" ] || continue - for file in "$dir"/* "$dir"/.*; do - [ -f "$file" ] && [ -x "$file" ] && basename "$file" - done +echo "$PATH" | tr ':' '\n' | while IFS= read -r dir; do + [ -d "$dir" ] || continue + find "$dir" -maxdepth 1 -type f -perm -111 -printf '%f\n' done | sort -u -- cgit v1.2.3