diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2020-03-06 02:17:10 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2020-03-06 02:17:10 +0100 |
commit | b7154d16f3cb94a9dde7a4d4f84dc900666aa9c1 (patch) | |
tree | d36eb33b4a0f91fa8ce1735f422766aa5f41de8e /tools | |
parent | 77d4eb2fba4b9d3e11ed8272d5d9dc9da3ca7454 (diff) |
tools/apply-colormap:palette(): Try to use a single write(2).
It appears the serial interface doesn't handle well multiple writes.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/apply-colormap | 5 |
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() { |