See this:
Code:
$ cat ea.txt
root 1933 1923 localhost calm 32rhewr
$ A=root
$ B=ROOT
$ sed 's/$A/$B/g' ea.txt
root 1933 1923 localhost calm 32rhewr
**No change above
So use double quotes instead of single quote:
$ sed "s/$A/$B/g" ea.txt
ROOT 1933 1923 localhost calm 32rhewr
So
LINECHANGE=`sed s/$OLDLINE/$NEWLINE/ $filename`
should be something like this:
LINECHANGE=`sed "s/$OLDLINE/$NEWLINE/" $filename`