break out mask2prefix function
trap transitory exit with debug shell