update_terminfo.sh: Use printf instead of echo

This commit is contained in:
Justin M. Keyes 2018-12-28 15:46:47 +01:00
parent e85b911f02
commit 959df5d8a5

View File

@ -76,15 +76,16 @@ EOF
for term in $sorted_terms; do
path="$(find "$db" -name "$term")"
if [[ -z $path ]]; then
echo "Not found: $term. Skipping." 1>&2
if [ -z "$path" ]; then
>&2 echo "Not found: $term. Skipping."
continue
fi
echo
printf '\n'
infocmp -L -1 -A "$db" "$term" | sed -e '1d' -e 's#^#// #' | tr '\t' ' '
echo "static const int8_t ${entries[$term]}[] = {"
echo -n " "; od -v -t d1 < "$path" | cut -c9- | xargs | tr ' ' ','
echo "};"
printf 'static const int8_t %s[] = {\n' "${entries[$term]}"
printf ' '
od -v -t d1 < "$path" | cut -c9- | xargs | tr ' ' ','
printf '};\n'
done >> "$target"
cat >> "$target" <<EOF