I don't understand how it will work now if it is missing the "$unc" variable. what is the 1>NUL 2>$1 for?

What is the subst command doing?