Skip to main content
added 3 characters in body
Source Link
terdon
  • 252.7k
  • 69
  • 481
  • 719

What would be the most handy way to grab the mousesmouse's mac address offrom the following output:

~ ➜ bt-device --list Added devices: Logitech K811 (00:1F:20:EB:06:E0) Plattan ADV Wireless (5C:EB:68:1F:D1:62) Bluetooth Mouse M336/M337/M535 (34:88:5D:3F:1B:88) 

Is there something shorter than this:

bt-device --list | grep Mouse | sed -e 's/^.*(\(.*\))$/\1/' 34:88:5D:3F:1B:88 

I'm looking for a syntax like:

bt-device --list | grep Mouse | xyztool '(' ')' 

What would be the most handy way to grab the mouses mac address of the following output:

~ ➜ bt-device --list Added devices: Logitech K811 (00:1F:20:EB:06:E0) Plattan ADV Wireless (5C:EB:68:1F:D1:62) Bluetooth Mouse M336/M337/M535 (34:88:5D:3F:1B:88) 

Is there something shorter than this:

bt-device --list | grep Mouse | sed -e 's/^.*(\(.*\))$/\1/' 34:88:5D:3F:1B:88 

I'm looking for a syntax like:

bt-device --list | grep Mouse | xyztool '(' ')' 

What would be the most handy way to grab the mouse's mac address from the following output:

~ ➜ bt-device --list Added devices: Logitech K811 (00:1F:20:EB:06:E0) Plattan ADV Wireless (5C:EB:68:1F:D1:62) Bluetooth Mouse M336/M337/M535 (34:88:5D:3F:1B:88) 

Is there something shorter than this:

bt-device --list | grep Mouse | sed -e 's/^.*(\(.*\))$/\1/' 34:88:5D:3F:1B:88 

I'm looking for a syntax like:

bt-device --list | grep Mouse | xyztool '(' ')' 

a handy linux Using regex to get mouse MAC address

Source Link

a handy linux regex

What would be the most handy way to grab the mouses mac address of the following output:

~ ➜ bt-device --list Added devices: Logitech K811 (00:1F:20:EB:06:E0) Plattan ADV Wireless (5C:EB:68:1F:D1:62) Bluetooth Mouse M336/M337/M535 (34:88:5D:3F:1B:88) 

Is there something shorter than this:

bt-device --list | grep Mouse | sed -e 's/^.*(\(.*\))$/\1/' 34:88:5D:3F:1B:88 

I'm looking for a syntax like:

bt-device --list | grep Mouse | xyztool '(' ')'