find and replace string (regex) across multiple files in linux using sed -
i have list of files strings {{abc-exfs-value}}
. sub string abc differs in each of file. example, regex search (java) like: \{\{*-exfs-value\}\}
return strings of concern here. how proceed on replacing strings match regex pattern in files in linux?
i able list of files using grep -r '\-exfs\-value' .
. using sed how replace strings?
i think what's needed:
sed -i.bak 's/\({{\)[[:alnum:]]\+\(-exfs-value}}\)/\1xyz\2/g' file1 file2 ...
Comments
Post a Comment