I'd recommend quotes around both variables in the grep line - never trust user input ;-)