From 10c627d2ae8bc6e3263b64b5dcdddea37ba7ca30 Mon Sep 17 00:00:00 2001 From: Shy Date: Sat, 3 Aug 2024 20:55:59 +0200 Subject: [PATCH] Revised sed command line --- wled | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wled b/wled index 32c870a..260c8be 100755 --- a/wled +++ b/wled @@ -46,10 +46,10 @@ case "$2" in l|list) echo "Presets on $wled_host:" curl $CURL_FLAGS "http://$wled_host/presets.json" | \ - # Split into lines. One line per preset. - sed --sandbox -n 's/"\([0-9]\{1,2\}\)"/\n"\1"/gp' | \ - # Extract number and name. Append final newline. - sed --sandbox -n 's/^"\([0-9]\{1,2\}\)":.*"n":"\([[:print:]]*\)".*$/\1: \2/p; a\' + # Split into lines - one line per preset. Append final newline. + sed --sandbox 's/"\(1\?[0-9]\)"/\n"\1"/g; $a\' | \ + # Extract number and name of every preset. + sed --sandbox -n 's/^"\(1\?[0-9]\)":.*"n":"\([[:print:]]*\)".*$/\1: \2/p' exit $? ;; dump)