diff options
author | Kir Kolyshkin <kolyshkin@gmail.com> | 2022-04-13 03:49:50 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2022-08-31 01:42:25 +0300 |
commit | ebe87704316990613dd765e19786e62948ccd80e (patch) | |
tree | e800dc1921f3925e326d890cd05c95a506e79aac | |
parent | 72d27e9818638b3f8762a713ac2ab840afcb152f (diff) |
scripts/protobuf-gen.sh: fix (not ignore) shellcheck warnings
This basically replaces
for x in $(sed ...); do
with
sed ... | while IFS= read -r x; do
The only caveat is, sed program was amended to remove empty lines
(there was one right above the PB_AUTOGEN_STOP).
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
-rw-r--r-- | scripts/protobuf-gen.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/protobuf-gen.sh b/scripts/protobuf-gen.sh index 0c738f13a..25d2feaeb 100644 --- a/scripts/protobuf-gen.sh +++ b/scripts/protobuf-gen.sh @@ -1,15 +1,15 @@ #!/bin/bash -# shellcheck disable=SC2013,SC1004 - TR="y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" -for x in $(sed -n '/PB_AUTOGEN_START/,/PB_AUTOGEN_STOP/ { +sed -n '/PB_AUTOGEN_START/,/PB_AUTOGEN_STOP/ { /PB_AUTOGEN_ST/d; + /^[ \t]*$/d; s/,.*$//; s/\tPB_//; p; - }' criu/include/protobuf-desc.h); do + }' criu/include/protobuf-desc.h | \ +while IFS= read -r x; do x_la=$(echo "$x" | sed $TR) x_uf=$(echo "$x" | sed -nr 's/^./&#\\\ /; |