$ hoge="a&b" $ echo "xyz" | sed "s/y/$hoge/" xaybz
$ echo "xyz" | sed "s/y/${hoge/&/\&}/" xa&bz
sed -i 's/from/to/' target_file.txt
sed -i 's/\(from\)/\1/' target_file.txt