0

I need to replace a string with the string which is mentioned in a file abcd.txt in all files in a folder.

For eg: I want to replace a string 'apple' with whatever the cat output of this file abcd.txt

I used the below command

grep -rl 'apple' /home/ron/log/temp | xargs sed -i 's/apple/$(cat /home/ron/output/id-3.txt)/g';

I'm getting the below error while doing it.

sed: -e expression #1, char 23: unknown option to `s'

Can anyone please help me on this

Am3Y
  • 67
  • 6

0 Answers0