dirname.t (435B)
- #!/bin/sh
- failed=0
- path=../bin/dirname
- status() {
- if [ "$2" -eq 0 ]; then
- echo "OK: ${1}"
- else
- echo "FAILED: ${1}"
- failed=1
- fi
- }
- [ "$(${path} 2>/dev/null)" = "" ] ; status "no args" $?
- [ "$(${path} /usr/bin)" = "/usr" ] ; status "/usr/bin" $?
- [ "$(${path} /usr//bin)" = "/usr" ] ; status "/usr//bin" $?
- ## POSIX-tests
- #[ "$(${path} //)" = "//" ] ; status "//" $?
- #[ "$(${path} ///)" = "///" ] ; status "///" $?
- exit $failed