summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-15 16:06:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-15 16:06:13 +0200
commit9b5f18e2df341f0e90cfc4e03d27ef11080adaaf (patch)
treeba12adda31d407dfe00d2b1e14512b13e4e0ece2
parent57fb18e59cce31a50a1ca62d1e192512c905ba00 (diff)
downloadusbutils-9b5f18e2df341f0e90cfc4e03d27ef11080adaaf.tar.gz
usb-devices: list the root devices in numerical order
Previously "usb10" would come before "usb2" Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rwxr-xr-xusb-devices4
1 files changed, 2 insertions, 2 deletions
diff --git a/usb-devices b/usb-devices
index 1ecca48..4e14608 100755
--- a/usb-devices
+++ b/usb-devices
@@ -178,7 +178,7 @@ if [ ! -d /sys/bus ]; then
exit 1
fi
-for device in /sys/bus/usb/devices/usb*
+for device in $(ls /sys/bus/usb/devices/ | grep ^usb | sort -V)
do
- print_device $device 0 0 0
+ print_device /sys/bus/usb/devices/$device 0 0 0
done