-2

The file contains spaces, so doing something like

data=`cat file.txt`
sed -e "s/pattern/$data/" input.file

gives me the error sed: -e expression #1, char 10: unterminated `s' command

I have tried edited all spaces in file.txt and prefixed them with a \ (so each space is now \ ) but it didnt help.

How can i replace just the word pattern with the contents of an entire files using sed?

1 Answers1

-2

Never mind,

I had missed the trailing white space which was the cause of the problem. jumped the gun.