Set way in a stray car

I have a file export.shthat has this content:

export JAVA_HOME="/opt/hadoop/jdk1.7.0_51"
export PATH=$JAVA_HOME/bin:$PATH

I have another shell script ( setup.sh) in which I use export.sh:

source /vagrant/export.sh

setup.sh called during preparation:

master.vm.provision :shell, path: "scripts/setup.sh"

But when the machine boots up and I try (for example):

which java

he shows a blank ...

How to enable added export of routes in Vagrant?

+3
source share
1 answer

Add the setup.shfollowing line to your file :

echo "source /vagrant/scripts/export.sh" >> /home/vagrant/.bashrc

This ensures that the export is loaded every time you ssh into the machine, what you want to do.

It is assumed that your setup.shis located in a directory /vagrant/scriptson your virtual machine.

+2
source

All Articles