added basic delete

This commit is contained in:
Emma Tebibyte 2023-07-13 15:22:49 -06:00
parent ef4e83c3d3
commit 9242bbfa6c
3 changed files with 28 additions and 2 deletions

12
en
View File

@ -72,7 +72,15 @@ while test -n "$1"; do
clear clear
;; ;;
"d") "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") "e")
eval "$args" || true eval "$args" || true
@ -82,7 +90,7 @@ while test -n "$1"; do
;; ;;
"p") "p")
out="$(syntax_h "$content" 2>/dev/null || printf "%s\n" "$content")" out="$(syntax_h "$content" 2>/dev/null || printf "%s\n" "$content")"
printf "%s" "$out" | nl -ba printf "%s\n" "$out" | nl -ba
;; ;;
"q") "q")
if test -n "$(printf "%s\n" "$content" | diff "$1" -)" if test -n "$(printf "%s\n" "$content" | diff "$1" -)"

0
xx00 Normal file
View File

18
xx01 Normal file
View File

@ -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