'Replacing a String from all the files with the value from text file
I have a text file named abcd.txt which has content dfunsufngsufspdfnsufbhpsdubf
I have multiple php files, py files in a folder names /home/admin/temp
All the files have a string replace-me
How can I replace this? I tried using the below script
NODE=1
BOY="/home/opc/firewall"
GIRL="$BOY/full/temp-$NODE"
grep -rl 'replace-me' $GIRL | xargs sed -i "s/replace-me/$(cat $GIRL/abcd3.txt)/g";
I'll be using this in a big script. Someone please help me in such case
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
