Why do you need `replace-in-string` here? Also, I am not sure this will work on XEmacs (which doesn't have `shell-command-to-string`).