From 197542488629970c54e0535ae5698b51281d88a2 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 20 Feb 2023 16:49:59 -0500 Subject: [PATCH] Switch to mapfile for a minor completions speed improvement --- extra/sshyp-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/sshyp-completion.bash b/extra/sshyp-completion.bash index a45e7b3..abea8a2 100755 --- a/extra/sshyp-completion.bash +++ b/extra/sshyp-completion.bash @@ -3,7 +3,7 @@ _path_gen() { local sshyp_path="$HOME/.local/share/sshyp" local sshyp_path_length="$(("${#sshyp_path}" + 1))" - readarray -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;) + mapfile -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;) for path in "${full_paths[@]}"; do trimmed_path=$(echo ${path%????} | cut -c"$sshyp_path_length"-) trimmed_path=$(echo ${trimmed_path// /\\ })