diff options
| author | Carlos Henrique Lima Melara <charlesmelara@riseup.net> | 2023-06-09 21:23:52 -0300 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2023-06-10 09:11:50 +0200 |
| commit | 4308819b9df8101bebc4c971f2de29c4cfc376df (patch) | |
| tree | 830fd25bd14d8b13f09cc49029fa2f3146a41655 | |
| parent | 56ed84a1b444b747917b7f5d371c62fad545eaa5 (diff) | |
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.
| -rwxr-xr-x | doc/gen-man.sh | 6 |
1 files 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" |
