chiark / gitweb /
bash-completion: avoid usage of ls for listing devices
authorDave Reisner <dreisner@archlinux.org>
Sun, 28 Oct 2012 16:27:27 +0000 (12:27 -0400)
committerDave Reisner <dreisner@archlinux.org>
Sun, 28 Oct 2012 16:27:27 +0000 (12:27 -0400)
bash-completion/systemd-bash-completion.sh

index 4398aaa..8d23268 100644 (file)
@@ -477,7 +477,10 @@ _hostnamectl() {
 }
 complete -F _hostnamectl 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
 
 _udevadm() {
         local i verb comps