lsusb
lsusb copied to clipboard
handle empty bus_num
When $bus_num is empty (e.g. in case of 05ac:8102 Apple Inc. Apple T2 Bus), the script throws the following error:
/usr/local/bin/lsusb: line 89: 16#: invalid integer constant (error token is "16#")
because it is not possible to treat an empty variable as a hexadecimal and convert it into an integer. My fix handles the situation by printing --- when the bus number is not provided.
@jlhonora, can this be merged?
This is the same problem fixed - in a different way - in https://github.com/jlhonora/lsusb/issues/18 also, so if you merge this one you can get a two-fer. #18 was a confirmed fix for the version I installed via homebrew.