summaryrefslogtreecommitdiff
path: root/help-from-md
diff options
context:
space:
mode:
Diffstat (limited to 'help-from-md')
-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"