From e7c9cad9a6a00d739eacf6b9902ded37522055d6 Mon Sep 17 00:00:00 2001 From: Janus Date: Sat, 14 Nov 2015 21:50:09 +0100 Subject: [PATCH] Fix paringhelper.sh to operate correctly for device names with apostrophe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the fix, a log entry for ‘Foo’s iPhone’ would be parsed as originating from the device “Foo”. I have changed the matching to include the parenthesis opening after the closing single quote. --- scripts/pairinghelper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pairinghelper.sh b/scripts/pairinghelper.sh index 2033a159..94ee2756 100755 --- a/scripts/pairinghelper.sh +++ b/scripts/pairinghelper.sh @@ -38,8 +38,8 @@ read -p "Press ENTER when ready..." yn echo -n "Looking in $logfile for Remote announcement..." sleep 5 -remote=`grep "Discovered remote" $logfile | tail -1 | grep -Po "'.*?'"` -remote="${remote%\'}" +remote=`grep "Discovered remote" $logfile | tail -1 | grep -Po "'.*' \("` +remote="${remote%\'\ \(}" remote="${remote#\'}" if [ -z "$remote" ]; then