Tags

, , , ,

For commenting the following snippets can be used :

sudo perl -i -p -e ‘ print “#” . ” ” if !/^#/ && /^read-only/; ‘ /etc/my.cnf

sed -i -e ‘s/^read-only/#&/g’ cnf

For uncommenting you can use the following snippets :

sudo perl -i -p -e ‘s/^#// if /^#/ && /read-only/; ‘ /etc/my.cnf

sed -i -e ‘s/^#*read-only/read-only/g’ cnf

Advertisements