#!/bin/sh TEST_DIR=`dirname $0` if [ $# -ne 1 ]; then echo "Usage: $0 title > $TEST_DIR/title.sh" 1>&2 echo 1>&2 echo "Example:" 1>&2 echo " $0 ECC-6666 > tests/grib_ecc-6666.sh" 1>&2 echo " $0 ECC-9999 > tests/bufr_ecc-9999.sh" 1>&2 echo 1>&2 exit 1 fi TEST_TITLE="$1" # Check label is unique grep -i -q "label=\"$TEST_TITLE\"" $TEST_DIR/*.sh if [ $? -eq 0 ]; then echo "ERROR: Test label \"$TEST_TITLE\" seems to already exist!" grep -l "label=\"$TEST_TITLE\"" $TEST_DIR/*.sh # Show results exit 1 fi cat <&2 echo "Remember to chmod 755 the new test" >&2 echo >&2