mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-05 04:25:20 +08:00
if more than one device is connected the tr command does not split the line resulting in pm3 --list
to fail.
This commit is contained in:
parent
944d6ee596
commit
cd554d67ab
1 changed files with 2 additions and 1 deletions
3
pm3
3
pm3
|
@ -182,7 +182,8 @@ function get_pm3_list_WSL {
|
|||
PM3LIST=()
|
||||
|
||||
# Normal SERIAL PORTS (COM)
|
||||
for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.PNPDeviceID -like '*VID_9AC4&PID_4B8F*' -or \$_.PNPDeviceID -like '*VID_2D2D&PID_504D*'} | Select -expandproperty DeviceID" 2>/dev/null | tr -dc '[:print:]'); do
|
||||
for DEV in $($PSHEXE -command "Get-CimInstance -ClassName Win32_serialport | Where-Object {\$_.PNPDeviceID -like '*VID_9AC4&PID_4B8F*' -or \$_.PNPDeviceID -like '*VID_2D2D&PID_504D*'} | Select -expandproperty DeviceID" 2>/dev/null); do
|
||||
DEV=$(echo $DEV | tr -dc '[:print:]')
|
||||
_comport=$DEV
|
||||
DEV=$(echo $DEV | sed -nr 's#^COM([0-9]+)\b#/dev/ttyS\1#p')
|
||||
# ttyS counterpart takes some more time to appear
|
||||
|
|
Loading…
Reference in a new issue