title: how to Export variables from shell script in a different user into current user?
body: <p>I have two user test1 and test2 I have some variables to be exported from sample.sh in test1. I want to export the values from test1 sample.sh into my test2 which is a current user I am in:</p>
  
  <pre><code># sample.sh
  export test="test1"
  echo "hi"
  export test2="test2"
  </code></pre>
  
  <p>I have tried this command:</p>
  
  <pre><code>su -test1 -c  ". /data/home/test1/.sample"
  </code></pre>
  
  <p><code>echo</code> is working and printing in my current user which is test2. But when I try <code>printenv</code> I cant see any test or test2 in there.</p>