better script to remove comments and rename

master
Alessandro Mauri 4 years ago
parent dd4a26da22
commit bcb18dc478
  1. 5
      posix/maketin

@ -143,7 +143,10 @@ lz4 --rm -9 -c "$DIRNAME.tar" > "$DIRNAME".tar.lz4
echo "Injecting payload..."
sed s/SUM/"$(cat "$SUMFILE")"/ "$PAYLOAD_SCRIPT" |
sed s/ID/"$(basename "$DIRNAME")"/ |
awk '!/^ *#/ && NF' > tpp
#awk '!/^ *#/ && NF' > tpp
sed -e '1{/^#!/ {p}}; /^[\t\ ]*#/d;/\.*#.*/ {/[\x22\x27].*#.*[\x22\x27]/ !{:regular_loop s/\(.*\)*[^\]#.*/\1/;t regular_loop}; /[\x22\x27].*#.*[\x22\x27]/ {:special_loop s/\([\x22\x27].*#.*[^\x22\x27]\)#.*/\1/;t special_loop}; /\\#/ {:second_special_loop s/\(.*\\#.*[^\]\)#.*/\1/;t second_special_loop}}' |
sed '/^$/d' > tpp
size="$(wc -c tpp | cut -d " " -f1)"
strsize="$(echo "BYTES" | wc -c)"
Loading…
Cancel
Save