I'm trying to automatically pull out the mac address of a arduino device using a shell script, and need some help how to do this.
This is the output returned by the command:
Opening /dev/cu.SLAB_USBtoUART @ 115200...
Connecting to ESP32 ROM, attempt 1 of 10...
Connecting to ESP32 ROM, attempt 2 of 10...
Connected, chip: ESP32D0WDQ5 R1
efuse_wr_disable : 0x0084
efuse_rd_disable : 0x1
flash_crypt_cnt : 0x01 (WD)
WIFI_MAC_Address : 0xaaaaaaaaaaaaaa (MAC: aa:bb:cc:dd:ee:ff)
SPI_pad_config_hd : 0x0
chip_package : 0x1
cpu_freq_low : 0x0
I am able to capture this into a shell script variable, but having a hard time trying to extract just the mac address of aa:bb:cc:dd:ee:ff
The output will always be the exact same, (MAC:
followed by the 17 characters that make up the mac address, then a closing )
Can someone please help me with a command I can use on a variable all this output is stored in, to get just the aa:bb:cc:dd:ee:ff
portion? I've been searching and trying for hours without luck, thank you!!