Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lsusb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Disclaimer: usage info and functionality from lsusb under Linux

verbose () { system_profiler SPUSBDataType; }
verbose () { system_profiler SPUSBDataType 2>/dev/null; }
version () { echo "lsusb for Mac OS X 007"; }
help () {
cat >&2 <<EOM
Expand Down Expand Up @@ -85,9 +85,13 @@ parse () {
esac
fi

# Convert bus number from hexadecimal to decimal.
bus_num=`echo "$((16#$bus_num))"`
bus_num=`printf "%0*d" 3 "$bus_num"`
if [ ${#bus_num} -ne 0 ]; then
# Convert bus number from hexadecimal to decimal.
bus_num=`echo "$((16#$bus_num))"`
bus_num=`printf "%0*d" 3 "$bus_num"`
else
bus_num='---'
fi

# Strip the parentheses from manufacturer name unless so specified.
if [ -z "$parens" ]; then
Expand Down