Trying to use sed to insert the contents of a file into the end of each line in another file
file1
This is a line
Here is another line
This is yet another line
Here is a fourth line
file2
TEXT
desired output
This is a line TEXT
Here is another line TEXT
This is yet another line TEXT
Here is a fourth line
This is what I'm trying with sed, thinking the dollar sign would put the text at the end of each line but it isn't. Any suggestions would be appreciated
> cat file1
This is a line
Here is another line
This is yet another line
Here is a fourth line
> cat file2
TEST
> sed '1 {x; d; n}; G; s/\n/ /' file2 file1
sed: command garbled: 1 {x; d; n}; G; s/\n/ /