More extensive documentation of sed script.
This commit is contained in:
parent
e2eeccd34f
commit
f8bb69594c
1 changed files with 8 additions and 4 deletions
12
wled
12
wled
|
@ -134,11 +134,15 @@ for wled_host in $host_list; do
|
||||||
printf "loading ...\r"
|
printf "loading ...\r"
|
||||||
active_ps=$(active_preset "$wled_host")
|
active_ps=$(active_preset "$wled_host")
|
||||||
curl_fetch "http://$wled_host/presets.json" | \
|
curl_fetch "http://$wled_host/presets.json" | \
|
||||||
# Insert newlines in front of every preset.
|
# Insert newline in front of every preset slice.
|
||||||
# Extract number and name of every preset.
|
# (Start of loop.)
|
||||||
|
# Match number and name of first preset.
|
||||||
|
# Replace in number: name format.
|
||||||
# Match and mark active preset.
|
# Match and mark active preset.
|
||||||
# Right-align numbers.
|
# Right-align number.
|
||||||
# Print up to next newline, delete up to next newline.
|
# Print out up to next newline.
|
||||||
|
# Delete up to next newline.
|
||||||
|
# Process next preset or end of loop.
|
||||||
# Prepend description.
|
# Prepend description.
|
||||||
sed --sandbox -n '
|
sed --sandbox -n '
|
||||||
s/"1\?[0-9]"[[:space:]]*:/\n&/g
|
s/"1\?[0-9]"[[:space:]]*:/\n&/g
|
||||||
|
|
Loading…
Reference in a new issue