Properly escape $CD variable