tve / esp32-backtrace

Simple bash script to annotate an ESP32 exception backtrace with source code info
MIT License
25 stars 7 forks source link

regex match not working #1

Open ghost opened 3 years ago

ghost commented 3 years ago

None of the regex matches are working in my script. Test case:

p='PC      : 0x4011aa98  PS      : 0x00060f30  A0      : 0x80082766  A1      : 0x3ffe3be0'
rePC='PC\s*:? (0x40[0-2][0-9a-f]*)'

if [[ "$p" =~ $rePC ]]; then
    echo Match!
else
    echo No match
fi

echo $BASH_VERSION

Output:

No match
5.1.0(1)-release

Hence gdb is never called. Perhaps "my" bash is broken. I work on a mac, same behavior with preinstalled version and upgrade to newest.

turgu1 commented 3 years ago

Works fine on Linux with version 5.0.17(1)-release.