summaryrefslogtreecommitdiff
path: root/scripts/sh/repl
diff options
context:
space:
mode:
authorGeorge Abbott <george@gabbott.dev>2025-01-26 11:37:22 +0000
committerGeorge Abbott <george@gabbott.dev>2025-01-26 11:37:22 +0000
commit82abadcecc7534b4847238ee2a977f33256b0439 (patch)
treead8752c1dc9914829e80bc2f3f1a45dfec8f4b4a /scripts/sh/repl
parentbac748dbe8c28cf1ed3b387b24f89ffe5a58ffc9 (diff)
sh
Diffstat (limited to 'scripts/sh/repl')
-rwxr-xr-xscripts/sh/repl8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/sh/repl b/scripts/sh/repl
new file mode 100755
index 0000000..3bd5607
--- /dev/null
+++ b/scripts/sh/repl
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+delim_begin="$1"
+delim_end="$2"
+contents_file="$3"
+dest="$4"
+
+sed -i -ne "/$delim_begin/ {p; r $contents_file" -e ":a; n; /$delim_end/ { p; b}; ba}; p" "$dest"