From 4308819b9df8101bebc4c971f2de29c4cfc376df Mon Sep 17 00:00:00 2001 From: Carlos Henrique Lima Melara Date: Fri, 9 Jun 2023 21:23:52 -0300 Subject: [PATCH] doc/gen-man.sh: use printf instead of echo to make it portable printf is recommended instead of echo because it has a more predictable behavior than echo (tip from the POSIX standard ;-). Using it allow us to generate the _same_ manpage using sh, dash or bash. --- doc/gen-man.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/gen-man.sh b/doc/gen-man.sh index ca4f841..276679e 100755 --- a/doc/gen-man.sh +++ b/doc/gen-man.sh @@ -55,12 +55,12 @@ gem_in=$( # First expression replaces all [Text like this] with bold text. # Second expression replaces text like *This* or _this_ with italic text. sed -E \ - -e 's#\[([^]]*)\]#\\\\fB\1\\\\fR#g' \ - -e 's#(^|[.,!? ]+)[*_]([^*_ ]+[^*_]+[^*_ ]+)[*_]($|[.,!? ])#\1\\\\fI\2\\\\fR\3#g' + -e 's#\[([^]]*)\]#\\fB\1\\fR#g' \ + -e 's#(^|[.,!? ]+)[*_]([^*_ ]+[^*_]+[^*_ ]+)[*_]($|[.,!? ])#\1\\fI\2\\fR\3#g' ) # Convert gemtext to man format -echo "$gem_in" | "$gemtext_converter" >> "$man_output" +printf "%s" "$gem_in" | "$gemtext_converter" >> "$man_output" # Write the tail to the output file. cat "$man_tail" >> "$man_output"