From 9242bbfa6c9ebb6b8bcccaaff5e6fc20bf66ee1c Mon Sep 17 00:00:00 2001 From: emma Date: Thu, 13 Jul 2023 15:22:49 -0600 Subject: [PATCH] added basic delete --- en | 12 ++++++++++-- xx00 | 0 xx01 | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 xx00 create mode 100644 xx01 diff --git a/en b/en index ab2789e..b4526f9 100755 --- a/en +++ b/en @@ -72,7 +72,15 @@ while test -n "$1"; do clear ;; "d") - printf "%s: d: Command not implemented.\n" "$argv0" 1>&2 + if test -z "$args"; then + printf "%s: %s: Missing argument.\n" "$argv0" "$command" 1>&2 + else + for line in $(printf "%s\n" "$args" | sed 's/,/\n/g') + do + del="$(printf "%s\n" "$content" | head -n "$line" | tail -n 1)" + content="$(printf "%s\n" "$content" | sed -n "/$del/!p")" + done + fi ;; "e") eval "$args" || true @@ -82,7 +90,7 @@ while test -n "$1"; do ;; "p") out="$(syntax_h "$content" 2>/dev/null || printf "%s\n" "$content")" - printf "%s" "$out" | nl -ba + printf "%s\n" "$out" | nl -ba ;; "q") if test -n "$(printf "%s\n" "$content" | diff "$1" -)" diff --git a/xx00 b/xx00 new file mode 100644 index 0000000..e69de29 diff --git a/xx01 b/xx01 new file mode 100644 index 0000000..e0d06ed --- /dev/null +++ b/xx01 @@ -0,0 +1,18 @@ +1 +2 +3 +4 +5 +6 +7 +8 + +this is a test file. + +it is very useful for testing things. + +meow +meow +meow meow +woof +test