'Return a command to expand tildes in a path
It can be either "~" or "~username".  We use the POSIX definition of
a username:
http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_426
http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_276'

def expand_user(self, user_home_path):

    if (user_home_path != '~'):
        if (not _USER_HOME_PATH_RE.match(user_home_path)):
            user_home_path = shlex_quote(user_home_path)
    return ('echo    %s' % user_home_path)
