mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-10-27 04:39:56 -04:00
Switch to mapfile for a minor completions speed improvement
This commit is contained in:
1 parent
eee0a3c3e3
commit
1975424886
1 file changed
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
_path_gen() {
|
_path_gen() {
|
||||||
local sshyp_path="$HOME/.local/share/sshyp"
|
local sshyp_path="$HOME/.local/share/sshyp"
|
||||||
local sshyp_path_length="$(("${#sshyp_path}" + 1))"
|
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
|
for path in "${full_paths[@]}"; do
|
||||||
trimmed_path=$(echo ${path%????} | cut -c"$sshyp_path_length"-)
|
trimmed_path=$(echo ${path%????} | cut -c"$sshyp_path_length"-)
|
||||||
trimmed_path=$(echo ${trimmed_path// /\\ })
|
trimmed_path=$(echo ${trimmed_path// /\\ })
|
||||||
|
|||||||
Reference in new issue
Block a user