chiark / gitweb /
bash-completion: avoid usage of ls for listing devices
[elogind.git] / bash-completion / systemd-bash-completion.sh
index 4398aaaf562481e3f7c077bfb9f69ef695456d36..8d232688ccca1ff48e51d0d0208e3c0e4483ba58 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