diff --git a/examples/awk/2.msh b/examples/awk/2.msh index 9d74888..84cee92 100644 --- a/examples/awk/2.msh +++ b/examples/awk/2.msh @@ -1 +1 @@ -.. :10: wl +.. :9: wl diff --git a/examples/awk/3.awk b/examples/awk/3.awk new file mode 100644 index 0000000..7af698d --- /dev/null +++ b/examples/awk/3.awk @@ -0,0 +1 @@ +{ print $NF } diff --git a/examples/awk/3.msh b/examples/awk/3.msh new file mode 100644 index 0000000..e32fc3a --- /dev/null +++ b/examples/awk/3.msh @@ -0,0 +1 @@ +wt (:-1: wl) each diff --git a/examples/awk/test.sh b/examples/awk/test.sh new file mode 100755 index 0000000..8499044 --- /dev/null +++ b/examples/awk/test.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +emp_test() { + if diff <(awk -f "$1".awk emp.data) <(mshell "$1".msh < emp.data); then + printf "%s. pass\n" "$1" + else + printf "%s. fail\n" "$1" + FAIL=1 + fi +} + +FAIL=0 + +emp_test 1 + +if diff <(seq 1 20 | awk -f '2.awk' ) <(seq 1 20 | mshell 2.msh); then + printf "2. pass\n" +else + printf "2. fail\n" + FAIL=1 +fi + +emp_test 3 + +exit "$FAIL"