How to escape double quotes inside another concatenated variable?
variable1=$(grep 'text' *.txt) -> value... <file="file.txt" stage="compile"
variable2=$(grep 'text' *.txt) -> value... size="10MB" process="zip">
variable3=$variable1' \"error\" '$variable2
variable3=<file="file.txt" stage="compile" "error" size="10MB" process="zip">
Desired output:
file="file.txt" stage="compile" "error" size="10MB" process="zip"
But I get this, without double quotes from variables 1 and 2:
file= stage= "error" size= process=
...then use value of variable3 in AWK command
AWK -i inplace NR=643 {sub(".*","${variable3}")};1' *.txt