How to use wildcards with sed -i ? I tried the [^']* form but no success.
I want to replace an unknown string following a known string
Code: Select all
B0='asdofnnadovnsoAFGSagFsbFbFBaFBAFD
ASDFAFDSfaSDFsfDSFSdgWREg4tSFB=='
with
Code: Select all
B0='AEGHETZHGRARegsfdbgSGFGAefsgwHaevagre
wERAHAGfwafvDSFadvgaerbrvgagr'
in the form
Code: Select all
SELECTED=B0
EDITS="AEGHETZHGRARegsfdbgSGFGAefsgwHaevagre
wERAHAGfwafvDSFadvgaerbrvgagr"
DOC='/root/test.txt'
sed -i "s/$SELECTED='.*'/$SELECTED='$EDITS'/" "$DOC"