]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Avoid -e option to sed for BSD.
authorWayne Davison <wayne@opencoder.net>
Mon, 15 Jun 2020 22:08:42 +0000 (15:08 -0700)
committerWayne Davison <wayne@opencoder.net>
Mon, 15 Jun 2020 22:08:42 +0000 (15:08 -0700)
help-from-md

index 21f49cd2627dd38c079dad5ad901933c77c629d1..a5b61577264c9087e46d20867d5c8e7890e521ec 100755 (executable)
@@ -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"