<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: export in scripts in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513252#M681247</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Yes, one 'export's a variable from a script to propagate it into any child environment.&lt;BR /&gt;&lt;BR /&gt;Yes, the environment exists only for the lifetime of the process and any child processes that inherit the environmental content.&lt;BR /&gt;&lt;BR /&gt;One way to pass variables from one script to another is to "source" or read a file:&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/A&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;fruit=apple&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/B&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;. /tmp/A&lt;BR /&gt;echo "I want a(n) ${fruit}"&lt;BR /&gt;&lt;BR /&gt;# /tmp/B&lt;BR /&gt;I want a(n) apple&lt;BR /&gt;&lt;BR /&gt;...Note the dot character; followed by whitespace; followed by the script to be "sourced" (read).  In this case, the variables declared in "A" are only available to "B" for its use.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Tue, 13 Oct 2009 15:50:24 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-10-13T15:50:24Z</dc:date>
    <item>
      <title>export in scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513251#M681246</link>
      <description>Why do people use export with variables in scripts?  I can only assume it is to set the environment variables.  Are the exports temporary just until the process stops running?  I am trying to gain a better understanding on the use of export in scripts.&lt;BR /&gt;Examples are below.&lt;BR /&gt;&lt;BR /&gt;export ORACLE_HOME=/oracle/app/product/forms9i&lt;BR /&gt;export TWO_TASK=ID&lt;BR /&gt;export TERM=vt100</description>
      <pubDate>Tue, 13 Oct 2009 15:42:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513251#M681246</guid>
      <dc:creator>Mrg_2</dc:creator>
      <dc:date>2009-10-13T15:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: export in scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513252#M681247</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Yes, one 'export's a variable from a script to propagate it into any child environment.&lt;BR /&gt;&lt;BR /&gt;Yes, the environment exists only for the lifetime of the process and any child processes that inherit the environmental content.&lt;BR /&gt;&lt;BR /&gt;One way to pass variables from one script to another is to "source" or read a file:&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/A&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;fruit=apple&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/B&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;. /tmp/A&lt;BR /&gt;echo "I want a(n) ${fruit}"&lt;BR /&gt;&lt;BR /&gt;# /tmp/B&lt;BR /&gt;I want a(n) apple&lt;BR /&gt;&lt;BR /&gt;...Note the dot character; followed by whitespace; followed by the script to be "sourced" (read).  In this case, the variables declared in "A" are only available to "B" for its use.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 13 Oct 2009 15:50:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513252#M681247</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-10-13T15:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: export in scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513253#M681248</link>
      <description>Exporting a variable makes it available to child processes.&lt;BR /&gt;&lt;BR /&gt;Easily demonstrated in a shell:&lt;BR /&gt;&lt;BR /&gt;babylon-4:itrc wout$ echo $TEST&lt;BR /&gt;value&lt;BR /&gt;babylon-4:itrc wout$ sh&lt;BR /&gt;sh-3.2$ echo $TEST&lt;BR /&gt;&lt;BR /&gt;sh-3.2$ exit&lt;BR /&gt;exit&lt;BR /&gt;babylon-4:itrc wout$ export TEST&lt;BR /&gt;babylon-4:itrc wout$ sh&lt;BR /&gt;sh-3.2$ echo $TEST&lt;BR /&gt;value&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Wout</description>
      <pubDate>Tue, 13 Oct 2009 15:53:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513253#M681248</guid>
      <dc:creator>Wouter Jagers</dc:creator>
      <dc:date>2009-10-13T15:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: export in scripts</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513254#M681249</link>
      <description>Thanks for the quick replies very helpful.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Oct 2009 16:20:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-scripts/m-p/4513254#M681249</guid>
      <dc:creator>Mrg_2</dc:creator>
      <dc:date>2009-10-13T16:20:27Z</dc:date>
    </item>
  </channel>
</rss>

