diff options
author | Wayne Davison <wayne@opencoder.net> | 2020-06-15 15:08:42 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2020-06-15 15:08:42 -0700 |
commit | 353dec11024d1b1d762c0d197fd267fed36741bf (patch) | |
tree | fac622d864db8d10fd9812d65bcafe56030cfc6d | |
parent | d80da9e674ea1d684564f03dfb09a65f9c5ab7a2 (diff) | |
download | rsync-353dec11024d1b1d762c0d197fd267fed36741bf.tar.gz |
Avoid -e option to sed for BSD.
-rwxr-xr-x | help-from-md | 13 |
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" |