From 353dec11024d1b1d762c0d197fd267fed36741bf Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 15 Jun 2020 15:08:42 -0700 Subject: [PATCH] Avoid -e option to sed for BSD. --- help-from-md | 13 ++++++------- 1 file 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" -- 2.47.2