#!/bin/sh #this script first tests to see if you entered the correct number #of command line args then proceeds through the if then elif structure #this tests to see if $# is 3 #$$ this is the PID of the current process echo $$ if test $# -eq 3 then echo you correctly entered 3 arguments elif test $# -eq 2 then echo you only entered 2 arguments, please try again exit 2 #the exit code will set $? to a value of 1 for the shell else echo you did not enter 3 command line arguments exit 1 fi #CSC128: Shell Script Examples - if-then-elif-else control structure