if [[ $2 != "" ]] then
export ARG2=$2
else
message "Second argument not specified: USAGE - $PROGRAM_NAME ARG1 ARG2"
checkerror -e 2 -m "Please specify if it is a history or weekly (H or W) extract in the 2nd argument"
fi
however, it always goes to the error message despite having 2 arguments
if [[ "$2" != "" ]] ; then
export ARG2="$2"
else
message "Second argument not specified: USAGE - $PROGRAM_NAME ARG1 ARG2"
checkerror -e 2 -m "Please specify if it is a history or weekly (H or W) extract in the 2nd argument"
fi
Then I suspect your second argument really is blank, or you threw away an argument with shift somewhere. Show the complete program, and show how you're using it.