@@ -129,14 +129,14 @@ function __hhs_dirs() {
129129
130130 # Load saved directories from file
131131 [[ -f " ${HHS_DIRS_FILE} " ]] && {
132- while IFS= __hhs_read -r line; do [[ -d " ${line} " ]] && results+=(" ${line} " ); done < " ${HHS_DIRS_FILE} "
132+ while IFS= read -r line; do [[ -d " ${line} " ]] && results+=(" ${line} " ); done < " ${HHS_DIRS_FILE} "
133133 }
134134
135135 # Append current shell dirs stack
136- while IFS= __hhs_read -r line; do [[ -d " ${line} " ]] && results+=(" ${line} " ); done < <( dirs -p -l)
136+ while IFS= read -r line; do [[ -d " ${line} " ]] && results+=(" ${line} " ); done < <( dirs -p -l)
137137
138138 # Deduplicate and sort
139- __hhs_read_array all_dirs < <( printf " %s\n" " ${results[@]} " | sort -u)
139+ while IFS= read -r line ; do all_dirs+=( " $line " ) ; done < <( printf " %s\n" " ${results[@]} " | sort -u)
140140 len=${# all_dirs[@]}
141141
142142 if [[ " $1 " == " -l" ]]; then
@@ -254,7 +254,7 @@ function __hhs_save_dir() {
254254 ret_val=0
255255 fi
256256 elif [[ " $1 " == " -c" ]]; then
257- __hhs_read_array all_dirs < " ${HHS_SAVED_DIRS_FILE} "
257+ while IFS= read -r l ; do all_dirs+=( " $l " ) ; done < " ${HHS_SAVED_DIRS_FILE} "
258258 for idx in $( seq 1 " ${# all_dirs[@]} " ) ; do
259259 dir=${all_dirs[idx - 1]}
260260 dir_alias=${dir%% =* }
@@ -275,7 +275,7 @@ function __hhs_save_dir() {
275275 else
276276 # Remove the old saved directory aliased
277277 ised -e " s#(^${dir_alias} =.*)*##g" -e ' /^\s*$/d' " ${HHS_SAVED_DIRS_FILE} "
278- __hhs_read_array all_dirs < " ${HHS_SAVED_DIRS_FILE} "
278+ while IFS= read -r l ; do all_dirs+=( " $l " ) ; done < " ${HHS_SAVED_DIRS_FILE} "
279279 all_dirs+=(" ${dir_alias} =${dir} " )
280280 printf " %s\n" " ${all_dirs[@]} " > " ${HHS_SAVED_DIRS_FILE} "
281281 sort -u " ${HHS_SAVED_DIRS_FILE} " -o " ${HHS_SAVED_DIRS_FILE} "
@@ -311,7 +311,7 @@ function __hhs_load_dir() {
311311 echo ' MSelect default : If no arguments is provided, a menu with options will be displayed.'
312312 else
313313
314- __hhs_read_array all_dirs < " ${HHS_SAVED_DIRS_FILE} "
314+ while IFS= read -r l ; do all_dirs+=( " $l " ) ; done < " ${HHS_SAVED_DIRS_FILE} "
315315
316316 if [ ${# all_dirs[@]} -ne 0 ]; then
317317
@@ -408,7 +408,7 @@ function __hhs_godir() {
408408 fi
409409 search_name=" $( basename " ${2:- $1 } " ) "
410410 pushd " ${search_path%/ } " & > /dev/null || echo
411- __hhs_read_array found_dirs < <( find -L . -type d -iname " *" " ${search_name} " 2> /dev/null)
411+ while IFS= read -r l ; do found_dirs+=( " $l " ) ; done < <( find -L . -type d -iname " *" " ${search_name} " 2> /dev/null)
412412 popd & > /dev/null || echo
413413 len=${# found_dirs[@]}
414414 # If no directory is found under the specified name
0 commit comments