From: Kevin Locke Date: Mon, 30 Oct 2017 19:50:51 +0000 (-0600) Subject: bash-completion: Exclude /dev/fd from fsck find X-Git-Tag: v2.32-rc1~239^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d22c1f533275ebf7060d9aa6dffc3ef265e81176;p=thirdparty%2Futil-linux.git bash-completion: Exclude /dev/fd from fsck find When the bash-completion for fsck runs `find -L /dev/ -type b` it descends into /dev/fd after opening '.' as file descriptor 3. This causes find to search through /dev/fd/3/ which includes everything below the current directory, which can take a very long time. To avoid this, prune /dev/fd in the find expression. Signed-off-by: Kevin Locke --- diff --git a/bash-completion/fsck b/bash-completion/fsck index 816422f52f..e5b4f53b4d 100644 --- a/bash-completion/fsck +++ b/bash-completion/fsck @@ -32,7 +32,8 @@ _fsck_module() return 0 ;; esac - COMPREPLY=( $(compgen -W "$(find -L /dev/ -type b 2>/dev/null)" -- $cur) ) + COMPREPLY=( $(compgen -W "$(find -L /dev/ -path /dev/fd -prune \ + -o -type b -print 2>/dev/null)" -- $cur) ) return 0 } complete -F _fsck_module fsck