
Eu tenho dois arquivos
arquivo1:
world,11
arquivo2:
hello welcome to the ("12345,67")
Estou tentando substituir o acima "(12345,67)"
por"world,11"
Responder1
De acordo com o que você postou acho que esse código vai resolver o seu problema:
replacement=`cat replacement.txt`
content=`cat content.txt`
pattern="pattern"
echo "${content//$pattern/$replacement}" # all strings matching will be replaced with $replacement
echo "${content/$pattern/$replacement}" # the first string matching the pattern will be replaced