[riot-notifications] [RIOT-OS/RIOT] usb-serial/list-ttys.sh: Broken when a debugger offers multiple serial ports (#15814)

Koen Zandberg notifications at github.com
Wed Jan 20 11:29:08 CET 2021


#### Description

Some USB devices offer multiple serial interfaces. The `list-ttys.sh` bash script used to be able to show these all as belonging to the same USB device. This is probably broken since #15351 and now multiple directories found by `find` are returned as a single string.

#### Steps to reproduce the issue

run `make -C examples/hello-world list-ttys` with a hifive1b connected, or another board that has a debugger with multiple serial ports.

#### Expected results

```
/sys/bus/usb/devices/1-1.1.2.3: SEGGER HiFive, serial: '000979014634', tty(s): ttyACM5, ttyACM4
```

#### Actual results

```
find: ‘/sys/bus/usb/devices/1-1.1.2.3/1-1.1.2.3:1.2/tty\n/sys/bus/usb/devices/1-1.1.2.3/1-1.1.2.3:1.0/tty’: No such file or directory
```

#### Versions

```
GNU bash, version 5.0.18(1)-release (x86_64-pc-linux-gnu)
```

#### Possible fix

As the script is already an bash script, a fix would be to store the result from find in an array like this:
https://stackoverflow.com/questions/23356779/how-can-i-store-the-find-command-results-as-an-array-in-bash/54561526#54561526

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/15814
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210120/a3de5886/attachment.htm>


More information about the notifications mailing list