#!/bin/bash # This shell script runs automated tests on programs. typeset SYNOPSIS="SYNOPSIS: $0 " typeset directory="$1" typeset firstpart; if [ -d "$directory" ] then # directory exists, therefore continue for executable in "$directory/*.exe" do printf "%s\n" $executable firstpart=`echo $executable | sed 's/.exe$//'` echo "firstpart is $firstpart" done elif [ $# -lt 1 ] then echo "No directory specified." echo "$SYNOPSIS" else echo "\"$directory\" is either not a directory or doesn't exist." echo "$SYNOPSIS" fi