Variable won't print out - awk

done.

You appear to be posting a code fragment. You pass $type to AWK but it is not set anywhere in the preceding script.

You have also neglected to show us the value of $OPTARG and AWK's input.

If you would like competent assistance, show us the complete script, exactly how you're calling it, any input provided to it, the actual output, and the desired output.

Regards,
Alister