split replace into replace and replace1 to allow setenv to be used by