Fix #217: make export escape $ in replacement string