Search code examples
bashshellautocompleteroot

Error after addition of bash_completion into root's .bashrc


I added the following lines into my /root/.bashrc file to enable to bash completion:

if [ -f /etc/bash_completion ]; then
   /etc/bash_completion
fi

But I receive the following error saying that I don't have rights to execute it...

bash: /etc/bash_completion: Permission non accordée

I also tried replacing the command's launch by the following command su -c /etc/bash_completion but nothing changed at all...
Can someone show me a way to avoid this error ?


Solution

  • The file /etc/bash_completion didn't had execution rights.
    I executed the following command and it now works : su -c chmod a+x /etc/bash_completion