So I am working on an install script for a program that needs the device id from lsusb in its configuration so I was thinking of doing the following:
$usblist=(lsusb)
#put the list into a array for each line.
#use the array to give the user a selection list usinging whiptail.
#from that line strip out the device id and vender id from the selected line.
The line looks as follows:
Bus 001 Device 004: ID 0665:5161 Cypress Semiconductor USB to Serial
So I want only the 9 characters after "ID{space}"
Asked by Martinn Roelofse
(11 rep)
May 28, 2018, 07:53 AM
Last activity: Jun 13, 2025, 09:06 PM
Last activity: Jun 13, 2025, 09:06 PM