diff --git a/reading03/Makefile b/reading03/Makefile new file mode 100644 index 0000000..d520675 --- /dev/null +++ b/reading03/Makefile @@ -0,0 +1,11 @@ +test: + @$(MAKE) -sk test-all + +test-all: test-scripts test-filters + +test-scripts: + curl -sLO https://www3.nd.edu/~pbui/teaching/cse.20289.sp25/static/txt/reading03/test_filters.sh + chmod +x test_filters.sh + +test-filters: + ./test_filters.sh diff --git a/reading03/filters.sh b/reading03/filters.sh new file mode 100644 index 0000000..15af442 --- /dev/null +++ b/reading03/filters.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +q1_answer() { + # TODO: Complete pipeline + echo "Read the fine manual" | tr '[:lower:]' '[:upper:]'. +} + +q2_answer() { + # TODO: Complete pipeline + echo "BTW, I use Arch" | sed 's/Arch/Pop/' +} + +q3_answer() { + # TODO: Complete pipeline + echo " Yes, do as I say" | sed 's/^ *//' +} + +q4_answer() { + # TODO: Complete pipeline + curl -sL https://yld.me/raw/yWh | grep '^root' | cut -d: -f7 +} + +q5_answer() { + # TODO: Complete pipeline + curl -sL https://yld.me/raw/yWh | grep ':4[0-9]*7:' +} + +q6_answer() { + # TODO: Complete pipeline + curl -sL https://yld.me/raw/yWh | sed 's#/bin/\(sh\|bash\|csh\|tcsh\)#/bin/zsh#g' | grep zsh +}