From 35cdd0437d0650f7640264529417fa2f4abcce5e Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 28 Oct 2012 12:27:27 -0400 Subject: bash-completion: avoid usage of ls for listing devices --- bash-completion/systemd-bash-completion.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bash-completion') diff --git a/bash-completion/systemd-bash-completion.sh b/bash-completion/systemd-bash-completion.sh index 4398aaaf56..8d232688cc 100644 --- a/bash-completion/systemd-bash-completion.sh +++ b/bash-completion/systemd-bash-completion.sh @@ -477,7 +477,10 @@ _hostnamectl() { } complete -F _hostnamectl hostnamectl -__get_all_sysdevs() { ls -1 -d /sys/bus/*/devices/* /sys/class/*/*; } +__get_all_sysdevs() { + local -a devs=(/sys/bus/*/devices/*/ /sys/class/*/*/) + printf '%s\n' "${devs[@]%/}" +} _udevadm() { local i verb comps -- cgit v1.2.3-54-g00ecf