chiark / gitweb /
bash-completion: avoid usage of ls for listing devices
[elogind.git] / bash-completion / systemd-bash-completion.sh
index 4398aaa..8d23268 100644 (file)
@@ -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