I trying to make control statement to check on a option flag is used or not? For -o output.file if is used I would like to make equal to variable OUTPUTSUM = OUTPUTFILE and if there no -o option use then I have it defaulted to relative path of the script? I just not sure how to go about checking for -o option?
while getopts i:o:h OPTION do case $OPTION in i) INPUTFILE=$OPTARG ;; o) OUTPUTFILE=$OPTARG ;; h) usage exit 1 ;; ?) usage exit ;; esac done if [-o EXIST]; then OUTPUTSUM = OUTPUTFILE else OUTPUTSUM = $SCRIPTPATH/SUMMARY fi