s/~/\$HOME/g for better sh/make/posix compatibility