fix sed command to replace ~ with $HOME