#!/bin/sh -u # $0 scriptname # The master script validator. Calls four other scripts, each of # which checks some part of the given script for validity. # -IAN! idallen@ncf.ca March 11, 2002 export PATH=/bin:/usr/bin umask 022 if [ "$#" -ne 1 ] ; then echo 1>&2 "$0: Expecting one script argument, found $# ($*)" exit 1 # return a bad exit code fi scriptname="$1" if [ ! -f "$scriptname" ]; then echo 1>&2 "$0: '$scriptname' is not a file" exit 1 # return a bad exit code fi if [ ! -r "$scriptname" ]; then echo 1>&2 "$0: '$scriptname' is not readable" exit 1 # return a bad exit code fi if [ ! -s "$scriptname" ]; then echo 1>&2 "$0: '$scriptname' is empty" exit 1 # return a bad exit code fi # Call four other scripts to validate the argument. # (You must write these other four scripts!) # ./first-scriptname "$scriptname" || exit $? ./second-scriptname "$scriptname" || exit $? ./third-scriptname "$scriptname" || exit $? ./fourth-scriptname "$scriptname" || exit $? echo "The script '$scriptname' passed all of the tests."