I thought of using something along those lines, but the likelyhood that HOME is not defined is pretty low, isn't it? Moreover, in some of what I've read ~ will be $HOME is set, otherwise the value of your passwd file, but I must say it is not clear where to find reference documentation on that topic.