basename.t (343B)
- #!/bin/sh
- failed=0
- path=../bin/basename
- status() {
- if [[ $2 -eq 0 ]]; then
- echo "OK: ${1}"
- else
- echo "FAILED: ${1}"
- failed=1
- fi
- }
- [[ "$(${path})" == "." ]] ; status "no args" $?
- [[ "$(${path} /usr/bin)" == "bin" ]] ; status "/usr/bin" $?
- [[ "$(${path} /usr/bin-test -test)" == "bin" ]] ; status "/usr/bin-test -test" $?
- exit $failed