I\'m currently using Vagrant to set up a development machine running Ubuntu. I want to add a few lines to my .profile that add directories to my $PATH
.profile
$PATH
To fix "sed: -e expression #1, char 44: extra characters after command", escape \n, that is add another backslash to all \n:
config.vm.provision "shell", inline: "sudo sed -i \'$ a if [ -d \\\"/usr/local/lib\\\" ] then\\n PATH=\\\"/usr/local/lib:$PATH\\\"\\nfi\' /home/vagrant/.profile"