From 86c56cb8fb1c0ab723cb79652f8e750c79006426 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 23 Aug 2016 20:33:01 +1200 Subject: Explicitly declare array to reassure shellcheck --- bash/bash_completion.d/man.bash | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bash/bash_completion.d') diff --git a/bash/bash_completion.d/man.bash b/bash/bash_completion.d/man.bash index d2499c0a..7456f69b 100644 --- a/bash/bash_completion.d/man.bash +++ b/bash/bash_completion.d/man.bash @@ -27,13 +27,12 @@ _man() { shopt -u dotglob shopt -s extglob nullglob - # Start an array of pages - declare -a pages - # Break manpath(1) output into an array of paths + declare -a manpaths IFS=: read -a manpaths -r < <(manpath 2>/dev/null) # Iterate through the manual page paths and add every manual page we find + declare -a pages for manpath in "${manpaths[@]}" ; do [[ -n $manpath ]] || continue if [[ -n $section ]] ; then -- cgit v1.2.3