Replace ~ with full variable