[systemd-commits] bash-completion/systemd-bash-completion.sh

Dave Reisner dreisner at kemper.freedesktop.org
Sun Oct 28 09:28:12 PDT 2012


 bash-completion/systemd-bash-completion.sh |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 35cdd0437d0650f7640264529417fa2f4abcce5e
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Sun Oct 28 12:27:27 2012 -0400

    bash-completion: avoid usage of ls for listing devices

diff --git a/bash-completion/systemd-bash-completion.sh b/bash-completion/systemd-bash-completion.sh
index 4398aaa..8d23268 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



More information about the systemd-commits mailing list