<?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 export in a script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456009#M728151</link>
    <description>Hi&lt;BR /&gt;  When i export a variable in a script, and try to use it from command prompt it does not seem to work.&lt;BR /&gt;ex:- in file a.sh&lt;BR /&gt;export PRA=XXX&lt;BR /&gt;echo $PRA&lt;BR /&gt;&lt;BR /&gt;execute a.sh&lt;BR /&gt; then try to do echo from prompt, the value is not set.&lt;BR /&gt;  What should I do set the value.&lt;BR /&gt;&lt;BR /&gt;please help&lt;BR /&gt;Praveen&lt;BR /&gt;</description>
    <pubDate>Fri, 20 Oct 2000 08:42:58 GMT</pubDate>
    <dc:creator>Praveen Bezawada</dc:creator>
    <dc:date>2000-10-20T08:42:58Z</dc:date>
    <item>
      <title>export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456009#M728151</link>
      <description>Hi&lt;BR /&gt;  When i export a variable in a script, and try to use it from command prompt it does not seem to work.&lt;BR /&gt;ex:- in file a.sh&lt;BR /&gt;export PRA=XXX&lt;BR /&gt;echo $PRA&lt;BR /&gt;&lt;BR /&gt;execute a.sh&lt;BR /&gt; then try to do echo from prompt, the value is not set.&lt;BR /&gt;  What should I do set the value.&lt;BR /&gt;&lt;BR /&gt;please help&lt;BR /&gt;Praveen&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Oct 2000 08:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456009#M728151</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2000-10-20T08:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456010#M728152</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The is expected.  The variable is local to your script (environment).  Only children of your script or inherit the variable.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 20 Oct 2000 08:47:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456010#M728152</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-20T08:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456011#M728153</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;this is normal behaviour.&lt;BR /&gt;export in a script is not 'back' exported.&lt;BR /&gt;When you start a script it executes in a sub shell that terminates on ending the script.&lt;BR /&gt;To have the variables in your own shell 'dot' the script:&lt;BR /&gt;. a.sh&lt;BR /&gt;then your script will not run in a subshell.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 20 Oct 2000 08:49:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456011#M728153</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-10-20T08:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456012#M728154</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you want shotcuts for some commands you better use the alias function. ie:&lt;BR /&gt;alias cdhome="cd /home"&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 20 Oct 2000 08:50:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456012#M728154</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-10-20T08:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456013#M728155</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;In addition to sourcing another file, you can create and export variables you need in your $HOME/.profile.  This is often done with for Oracle user profiles.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 20 Oct 2000 08:53:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456013#M728155</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-20T08:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456014#M728156</link>
      <description>As has already been mentioned, a child cannot set an environment variable for the parent.  What you can do, however, is save the value in a file and read the file from the parent.  For example, in a.sh,&lt;BR /&gt;&lt;BR /&gt;  echo "Value" &amp;gt; valueFile&lt;BR /&gt;&lt;BR /&gt;and then set the value from the command prompt by using command substitution,&lt;BR /&gt;&lt;BR /&gt;  var=$( cat valueFile )</description>
      <pubDate>Thu, 16 Nov 2000 21:18:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456014#M728156</guid>
      <dc:creator>Bruce Regittko_1</dc:creator>
      <dc:date>2000-11-16T21:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456015#M728157</link>
      <description>I once thought it might be possible to place variables in the calling environment with some 'exec' trickery. But 'export' (or 'declare -x') are shell built-ins (they don't exist anywhere as regular executables), so you can't 'exec' them.</description>
      <pubDate>Thu, 16 Nov 2000 22:48:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456015#M728157</guid>
      <dc:creator>Kevin Ernst</dc:creator>
      <dc:date>2000-11-16T22:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456016#M728158</link>
      <description>If the only thing the script is doing is seting env variable you can profile the script. Set the execute bit on the file then enter this:&lt;BR /&gt;&lt;BR /&gt;. ab.sh&lt;BR /&gt;&lt;BR /&gt;This will treat the file like .profile and then you will retain the variables.</description>
      <pubDate>Fri, 17 Nov 2000 01:26:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456016#M728158</guid>
      <dc:creator>Lawrence Mahan</dc:creator>
      <dc:date>2000-11-17T01:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456017#M728159</link>
      <description>If the only thing the script is doing is seting env. variables then run the script as a .profile script. Set the execute bit on the script then enter this:&lt;BR /&gt;&lt;BR /&gt;. ab.sh&lt;BR /&gt;&lt;BR /&gt;NOTE THE DOT&lt;BR /&gt;&lt;BR /&gt;THis will treat the script as a .profile. THe variables should then take properly.</description>
      <pubDate>Fri, 17 Nov 2000 01:28:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456017#M728159</guid>
      <dc:creator>Lawrence Mahan</dc:creator>
      <dc:date>2000-11-17T01:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: export in a script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456018#M728160</link>
      <description>Actually Larry,&lt;BR /&gt;&lt;BR /&gt;I don't think the execute bit even needs to be set when a file is sourced.  The PATH variable will be referenced, however, if a path is not specified on the command line.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Nov 2000 10:33:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/export-in-a-script/m-p/2456018#M728160</guid>
      <dc:creator>Bruce Regittko_1</dc:creator>
      <dc:date>2000-11-17T10:33:51Z</dc:date>
    </item>
  </channel>
</rss>

