using script to pass variables to sopt