rr=abcd # in shell sed -i "s/aaa/$rr/g" file.dat # -i will update thefile,
sed -i -e "s/aaa/bbb/g" -e "s/sss/bbb/g" file #-i update document