I have the below sed command:
Ctimezone="$shortName = exec('date +%Z');\
$longName = timezone_name_from_abbr($shortName);\
date_default_timezone_set($longName);"
sed -i 10s@.*@$Ctimezone@ /home/file.php
However this gives me the error:
sed -e expression #1, char 7: unterminated 's' command
My understanding of sed is not great so im sure its an easy fix but couldn't work it out myself.
If you need any more info let me know
Changed to:
sed -i "10s@.*@$Ctimezone@" /home/file.php
but what is put into file.php is:
= exec('date +%Z'); = timezone_name_from_abbr(); date_default_timezone_set();
not
$shortName = exec('date +%Z'); $longName = timezone_name_from_abbr($shortName); date_default_timezone_set($longName);