I am trying to write a script that copies the file
log_REPLACE, and replaces the string
REPLACE in the name of the file, and within the file with the letter
So I want to create
log_b, and the string
REPLACE inside them is replaces with the letter A and B in them respectively.
cp log_REPLACE log_A cp log_REPLACE log_B grep -rl REPLACE | xargs sed -i 's/REPLACE/A/g'
but that end up rewriting in both copies (*A and *B). is there a better way to do this?