diff options
| author | filip <“filip.rabiega@gmail.com”> | 2025-11-06 16:32:49 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2025-11-06 16:32:49 +0100 |
| commit | 3806e4ee48ece7f02e7c730ee49d4f830afd165b (patch) | |
| tree | 0155f3cea2e8c026d7892c71df8520879a21bff2 /printpath | |
| parent | 0d097e68ef56160b8a7a4c66357ca09a4bdc6ef9 (diff) | |
| download | chadscripts-3806e4ee48ece7f02e7c730ee49d4f830afd165b.tar.gz chadscripts-3806e4ee48ece7f02e7c730ee49d4f830afd165b.tar.bz2 chadscripts-3806e4ee48ece7f02e7c730ee49d4f830afd165b.zip | |
optimized things xoxo
Diffstat (limited to 'printpath')
| -rwxr-xr-x | printpath | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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 |
