diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-09-07 13:39:11 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-09-07 13:39:11 -0700 |
| commit | 393778ffabecc8fabadc72b9f0bce5340863406d (patch) | |
| tree | 707f3ec1834c7c2dbbb49226f598e883add52cda /tutorial.sh | |
| parent | f3eb2e99cdca225a66ae2d78f59abe2fa0d85482 (diff) | |
Shortening \033[0m -> \033[m
Diffstat (limited to 'tutorial.sh')
| -rwxr-xr-x | tutorial.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tutorial.sh b/tutorial.sh index e598612..6c47a3f 100755 --- a/tutorial.sh +++ b/tutorial.sh @@ -8,17 +8,17 @@ for t in $([ $# -gt 0 ] && echo "$@" || ls -v tests/*.sh); do echo printf "\033[1m" sed -n 's/^# //p' "$t" - printf "\033[0m" - printf "\033[33;1mGiven these lines: Give this output:\033[0m\n" + printf "\033[m" + 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[0m" + printf "\n\033[1mbp pattern: \033[m" read -r pat - printf "\033[0;2mRunning: \033[32m%s\033[0m\n\n" "bp -p '$pat'" - printf "\033[33;1mExpected output: Your pattern's output:\033[0m\n" + 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 cat "$tmpfile" - printf "\n\033[0;1;31mSorry, try again!\033[0m\n" + printf "\n\033[0;1;31mSorry, try again!\033[m\n" done - printf "\n\033[0;1;32mCorrect!\033[0m\n" + printf "\n\033[0;1;32mCorrect!\033[m\n" done |
