From d22c1f533275ebf7060d9aa6dffc3ef265e81176 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Mon, 30 Oct 2017 13:50:51 -0600 Subject: 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 --- bash-completion/fsck | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bash-completion') diff --git a/bash-completion/fsck b/bash-completion/fsck index 816422f52..e5b4f53b4 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 -- cgit v1.2.3-55-g7522