I need a shell script to replace a string pattern in multiple text files.
By pattern I mean like this occurance in multiple files:
CSRF=PG0U-8R3L-KLXT-7UWT-TSRS-IFLY-OI9Y-M75C
CSRF=X67S-3QHA-LNT8-D83N-5BS3-2WA4-7BDP-J1NQ
CSRF=TATJ-3QHA-LNT8-D83N-AGHJ-AGJD-7BDP-JGAJ
CSRF=DHJG-8R3L-AFJH-ASGJ-TSRS-ADGJ-OI9Y-AGHJ
So in general its like CSRF=$$$$-$$$$-$$$$-$$$$-$$$$-$$$$-$$$$$-$$$$ where $=any alphanumeric
I already have the sed command to find and replace the old text with the new text. But here i am looking for the string pattern to search and replace.
The command I have is :
oldtext="CSRF=$$$$-$$$$-$$$$-$$$$-$$$$-$$$$-$$$$$-$$$$"
newtext="CSRF Replaced"
find -iname '*.txt' | xargs sed -i "s/$oldtext/$newtext/g"
So my question is... How do I search for this CSRF String pattern???