summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2020-06-15 15:08:42 -0700
committerWayne Davison <wayne@opencoder.net>2020-06-15 15:08:42 -0700
commit353dec11024d1b1d762c0d197fd267fed36741bf (patch)
treefac622d864db8d10fd9812d65bcafe56030cfc6d
parentd80da9e674ea1d684564f03dfb09a65f9c5ab7a2 (diff)
downloadrsync-353dec11024d1b1d762c0d197fd267fed36741bf.tar.gz
Avoid -e option to sed for BSD.
-rwxr-xr-xhelp-from-md13
1 files changed, 6 insertions, 7 deletions
diff --git a/help-from-md b/help-from-md
index 21f49cd2..a5b61577 100755
--- a/help-from-md
+++ b/help-from-md
@@ -10,13 +10,12 @@ helpfile="$2"
newfile="$helpfile.new"
findfile="${helpfile/./\\.}"
-sed -e '1,/^\[comment\].*'"$findfile"'/d' \
- -e '1,/^```/d' \
- -e '/^```/,$d' \
- -e 's/"/\\"/g' \
- -e 's/^/ rprintf(F,"/' \
- -e 's/$/\\n");/' \
- <"$mdfile" >"$newfile"
+sed '1,/^\[comment\].*'"$findfile"'/d' <"$mdfile" | \
+ sed '1,/^```/d' | \
+ sed '/^```/,$d' | \
+ sed 's/"/\\"/g' | \
+ sed 's/^/ rprintf(F,"/' | \
+ sed 's/$/\\n");/' >"$newfile"
if [[ ! -s "$newfile" ]]; then
rm "$newfile"