summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/bash-arrays.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/public/bash-arrays.md b/public/bash-arrays.md
index 23d90bb..e7f5842 100644
--- a/public/bash-arrays.md
+++ b/public/bash-arrays.md
@@ -348,8 +348,9 @@ an array is when you didn't want an array, but it's what you get
# Does not correctly handle programs with a newline in the name,
# as the output is newline-separated.
path_ls() {
- local dirs
- IFS=: dirs=($@) # The odd-ball time that it needs to be unquoted
+ local IFS dirs
+ IFS=:
+ dirs=($@) # The odd-ball time that it needs to be unquoted
find -L "${dirs[@]}" -maxdepth 1 -type f -executable \
-printf '%f\n' 2>/dev/null | sort -u
}