title: Using .sh script to set an environment variable
body: <p>How do I write an .sh script what will globally set an environment variable on Ubuntu 14. </p>
  
  <p>i.e. </p>
  
  <pre><code>#!/bin/sh
  sets this in to master /etc/environment 
  export DB_HOST="123"
  </code></pre>
  
  <p>I am aware I could just run this script and it would set it for the session only!, but what I actually want to do is have the .sh script copy the environment variable to /etc/environment so it is system wide.</p>
  
  <p>OR </p>
  
  <p>is there a way to run the script that it gets set globally?</p>