From def55011be606f1a8ddb7b819c0f270c0222f580 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 12 Jun 2020 02:02:53 +0200 Subject: [PATCH] and the other one... --- pm3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pm3 b/pm3 index c3829b796..771dce77d 100755 --- a/pm3 +++ b/pm3 @@ -152,7 +152,7 @@ function get_pm3_list_WSL { # Need to look for this first, the call to Win32_serialport "crashes" then native bt serial port. Don't ask why. #BT direct SERIAL PORTS (COM) if $FINDBTRFCOMM; then - for DEV in $(powershell.exe -command "Get-CimInstance -ClassName Win32_PnPEntity | Where-Object Caption -like 'Standard Serial over Bluetooth link (COM*' | Select Name" 2> /dev/null | awk '$0 ~ /COM/{print substr($6,2,5)}'); do + for DEV in $(powershell.exe -command "Get-CimInstance -ClassName Win32_PnPEntity | Where-Object Caption -like 'Standard Serial over Bluetooth link (COM*' | Select Name" 2> /dev/null | awk 'match($0,/COM([0-9]+)/,m){print m[1]}'); do DEV=${DEV/ */} DEV="/dev/ttyS${DEV#COM}"