. "$BST_LIB" require tcsh tcsh/present # version banner check_out tcsh/version "tcsh 6" tcsh --version # csh-language payload: control flow, list arithmetic, string compare out=$(tcsh -f "$BST_DATA/selftest.csh" 2>&1); rc=$? case "$out" in *ALL-TCSH-OK*) all=1 ;; *) all=0 ;; esac if [ "$rc" -eq 0 ] && [ "$all" -eq 1 ]; then bst_ok tcsh/script-ok else bst_notok tcsh/script-ok "rc=$rc $(_bst_1line "$out")"; fi # fine-grained: values the payload printed as tagged lines check_eq tcsh/sum 15 "$(printf '%s\n' "$out" | awk '/^R1-sum/{print $2}')" check_eq tcsh/fib15 610 "$(printf '%s\n' "$out" | awk '/^R2-fib15/{print $2}')" check_eq tcsh/mul 42 "$(printf '%s\n' "$out" | awk '/^R4-mul/{print $2}')" # inline -c: csh integer arithmetic straight from the shell check_out tcsh/expr "42" tcsh -f -c '@ x = 6 * 7; echo $x'