Revised sed command line
This commit is contained in:
parent
bdde1235dc
commit
10c627d2ae
1 changed files with 4 additions and 4 deletions
8
wled
8
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)
|
||||
|
|
Loading…
Reference in a new issue