From 6287dc19411666693e79ed569adefead0cea42ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20G=C3=A9czi?= Date: Thu, 6 Nov 2025 00:00:00 +0000 Subject: [PATCH] Simplify and fix device name extraction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Correclty handles when the device name ends with `)` * Drops superfluous `sed` Before: ``` ./fido2-manage.sh -list Device [1] : TOKEN2 FIDO2 Security Key(0016 ``` After: ``` ./fido2-manage.sh -list Device [1] : TOKEN2 FIDO2 Security Key(0016) ``` Signed-off-by: Ferenc Géczi --- fido2-manage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 fido2-manage.sh diff --git a/fido2-manage.sh b/fido2-manage.sh old mode 100644 new mode 100755 index a7f7417..34bcab5 --- a/fido2-manage.sh +++ b/fido2-manage.sh @@ -123,7 +123,7 @@ if $list; then echo "$command_output" | while read -r line; do if [[ $line =~ ^([^:]+) ]]; then - echo "Device [$device_count] : $(echo "${line}" | grep -oP '\(([^)]+)\)' | sed 's/(\(.*\))/\1/')" + echo "Device [$device_count] : $(echo "${line}" | grep -oP '(?<=\()(.+)(?=\))')" device_count=$((device_count + 1)) fi