Your trouble is probably that $REP
contains slashes, but you're using /
to delimit the regular expression. The easiest fix is to use some other character to delimit the regular expression, perhaps %
:
sed -i 's%\$app\[\"bundle.root\"\] = \"\/var\/www\/\"\;%\$app\[\"bundle.root\"] = \"'$REP'\"\;%' /home/martialp/Documents/default.php
You can use any character that doesn't otherwise appear in the command; Control-A, for example, works well and is unlikely to appear in $REP
.