s/x/$(D x)/g

use regular quotes " for quotes, not backticks