есть файл /etc/bash.bashrc хочу в нем раскоментирвоать блок
# enable bash completion in interactive shells #if ! shopt -oq posix; then # if [ -f /usr/share/bash-completion/bash_completion ]; then # . /usr/share/bash-completion/bash_completion # elif [ -f /etc/bash_completion ]; then # . /etc/bash_completion # fi #fi
пробовал вариант с
from fabric.contrib.files import uncomment uncomment('/etc/bash.bashrc','if ! shopt -oq posix; then') uncomment('/etc/bash.bashrc','if [ -f /usr/share/bash-completion/bash_completion ]; then") uncomment('/etc/bash.bashrc',' . /usr/share/bash-completion/bash_completion') uncomment('/etc/bash.bashrc',' elif [ -f /etc/bash_completion ]; then') uncomment('/etc/bash.bashrc',' . /etc/bash_completion') uncomment('/etc/bash.bashrc',' fi') uncomment('/etc/bash.bashrc','fi')
но не получается

как можно решить задачку, подскажите пожалуйста