It's not possible via command line(CLI) to set a variable which has a character ~ . It is always replaced by ".