Script to source bin/

I am having a problem with a little bash script I wrote; here it is


echo "Moving to the root directory..."
cd /home/$USER/root-6.02.08/
echo "Executing the script..."
source bin/
echo "Moving back to /home/$USER..."
cd /home/$USER
echo "Done."

It doesn’t seem to work; could anybody help me out? My current OS is Linux Mint 17, and when I manually do what the script does root works flawlessly…

Well, doing “source bin/” will setup ROOT inside of your shell script, but it will not be visible outside.
Try to create a shell alias:
alias myroot=". /home/${USER}/root-6.02.08/bin/"
or a shell function:
myroot() { . /home/${USER}/root-6.02.08/bin/; }

That was roughly what I thought. Thanks for the advice, it worked perfectly