--- parser3/tests/cat.sh 2007/11/16 08:21:13 1.1 +++ parser3/tests/cat.sh 2024/10/22 02:46:46 1.4 @@ -1,16 +1,39 @@ #!/bin/sh +if [ $1 = "halt" ] +then + exit $2 +fi + +if [ $1 = "stdin" ] +then + cat + exit 0 +fi + +if [ $1 = "args" ] +then + for arg in "$@"; do + echo -n "\"$arg\" " + done + exit 0 +fi + if [ $1 = "cgi" ] then echo "content-type: $2 " fi - -if [ -n "$4" ] +if [ -n "$5" ] then - echo "$4" + echo "$5" fi cat -s $3 +if [ -n "$4" ] +then + exit $4 +fi +