Two things I will mention: lsusb and udev rules. I have a set of udev rules that match ttyusb devices by path (they don't implement serial numbers, which would be better) and give them a consistently named symlink. I use /dev/ttyRn, where n is a whole number. That means no matter what order they are enumerated in, I can find the device.
I don't know if that helps with your problem or not, but I have found them to be useful in adjacent problems. -- Russell On Fri, Jan 19, 2024, 15:17 Vince Winter <thine.technoc...@gmail.com> wrote: > Hello, > > I am trying to write a bash script to detect if USB device is plugged into > a device and post a message with a device name that is plugged to stdout. > > Complications are USB webcams, USB controllers, and this is going to be > used on large number of systems, so I can't customize to each system. >