This question already has an answer here:

I'm trying to replace text with the contents of a file and I'm getting errors.

This works:

cat /tmp/test | sed -e "s/__TEST__/$(cat pass)/g"

But this one doesn't

cat /tmp/test | sed -e "s/__TEST__/$(cat \/etc\/passwd)/g"

Is there a way to get the contents of a file with the full path inside of sed?

marked as duplicate by steeldriver, Community Apr 21 '15 at 21:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.