aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2020-03-06 02:17:10 +0100
committerGuilhem Moulin <guilhem@fripost.org>2020-03-06 02:17:10 +0100
commitb7154d16f3cb94a9dde7a4d4f84dc900666aa9c1 (patch)
treed36eb33b4a0f91fa8ce1735f422766aa5f41de8e
parent77d4eb2fba4b9d3e11ed8272d5d9dc9da3ca7454 (diff)
tools/apply-colormap:palette(): Try to use a single write(2).HEADmaster
It appears the serial interface doesn't handle well multiple writes.
-rwxr-xr-xtools/apply-colormap5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/apply-colormap b/tools/apply-colormap
index 56d90e0..d59ddd2 100755
--- a/tools/apply-colormap
+++ b/tools/apply-colormap
@@ -73,9 +73,8 @@ colormap() {
}
palette() {
- printf "palette"
- sed "/^\\s*#/d; s/\\s*#.*//" <"$PALETTE" \
- | sed -nr "1h;1!H; \${x; s/^\\s*/ /; s/\s+/ /g; p}"
+ { echo "palette"; sed "/^\\s*#/d; s/\\s*#.*//" <"$PALETTE"; } \
+ | sed -r ':a; $!N; s/\n/ /; ta; s/\s+/ /g'
}
serial_send() {