Originally Posted by mariakumar
First we need to find the string of "A.words" in file at starting the line, after equals(=) update with the new string.
Perhaps you mean something like:
sed -i "s/\(^A.words=\).*/\1$NEWSTRING/" file
This looks for the literal string "A.words=" at the start of the line, and replaces it with the same thing (that's why the \1 is there on the Right Hand Side), and the $NEWSTRING variable is put after the "=" sign.
EDIT: If you want to replace every
occurrence, add the "g" to the end of the sed expression, inside the quotes - like I did in post #5
EDIT2: Never mind that edit - if the match is at the beginning of the line, then there can only be *one* match per line.
Is this what you're getting at?