I would like to use this script with the intention of replacing all instances of the letter Q within a file with the contents of the file "question.txt". Instead what happens is that all the instances of Q in the file disappear and the contents of "question.txt" are printed at the bottom of the new file.
Any ideas?
sed -i.bkp '/Q/{
s/Q//g
r /Users/ericbrotto/Desktop/question.txt
}' Commision.txt
EDIT 1
I'm trying to find out what version I have, but keep on getting this:


GNU sed-Version 4.2.1, without the content of 'question.txt' printed at the bottom of the new file. – user unknown Jul 26 '11 at 1:01GNU sed version 4.2.1. A simple set of test files where the search string was in the middle of the file left the read file at the end, not in place of the searched string. – Caleb Jul 26 '11 at 8:35sed --version– Caleb Jul 26 '11 at 8:35