expand a special variables in paths, e.g. ~ (tilde)