aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2022-04-09 14:30:50 -0400
committerBruce Hill <bruce@bruce-hill.com>2022-04-09 14:30:50 -0400
commitbae576a997619a06ed323fa403e1300e72ef83e7 (patch)
tree4a323854889ff5ade307dcc3012818bd48859dcd
parentf33e2e1ec9aef252952565644f6ebe02065f1943 (diff)
Enhancing the illusion of a shell
-rwxr-xr-xtutorial.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tutorial.sh b/tutorial.sh
index effdbc1..70f87dd 100755
--- a/tutorial.sh
+++ b/tutorial.sh
@@ -12,8 +12,9 @@ for t in $([ $# -gt 0 ] && echo "$@" || ls -v tests/*.sh); do
printf "\033[33;1mGiven these lines: Give this output:\033[m\n"
diff -y -W60 --color=always "${t/.sh/.in}" "${t/.sh/.out}"
while true; do
- printf "\n\033[1mbp --pattern \033[m"
+ printf "\n\033[1m$ bp --pattern ''\033[D\033[m"
read -r pat
+ pat="${pat%\'}"
printf "\033[0;2mRunning: \033[32m%s\033[m\n\n" "bp -p '$pat'"
printf "\033[33;1mExpected output: Your pattern's output:\033[m\n"
bp -p "$pat" < "${t/.sh/.in}" 2>"$tmpfile" | diff -y -W60 --color=always "${t/.sh/.out}" - && break