Answer the question
In order to leave comments, you need to log in
How to remotely execute sed with quotes?
how to replace part of the string after "$config['product_name'] = ".
need to do the replacement remotely: ssh [email protected] "sed ...."
# cat 4del/file4del.php
$config['enable_spellcheck'] = false;
$config['language'] = 'ru_RU';
$config['create_default_folders'] = true;
// Branding
$config['product_name'] = 'здесь может быть что угодно';
//$config['skin_logo'] = null;
sed "s/^\$config\['product_name'\] = .*/\$config\['product_name'\] = 'My Company Webmail';/"
Answer the question
In order to leave comments, you need to log in
Here I wrote how to screen tricky characters in gray
sed -i 's/\x24config\[\x27product_name\x27\] = \x27true\x27\x3B/\x24config\[\x27product_name\x27\] = \x27false\x27\x3B/' /etc/lalala/lala.conf
ssh [User_Name]@[Rremote_Host_Name or IP] [Command or Script]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question