sed replace variables while read lines
问题 I'm working on a shell script and i need to change some strings from different lines of a file into a while read statement. The structure need to be like this, because the String_Search and String_result will be calculated on each line. while read line do varA="String_Search" resA="String_Result" line=`echo $line | sed -e "s/$varA/$resA"` echo $line >> outputFile.txt done < "inputFile.txt" The script doesn't works and its showing to me this error message: sed: -e expression #1, char 31: