<?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: Setting my SHELL variables in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366065#M194853</link>
    <description>Hi (again) Nagendra,&lt;BR /&gt;&lt;BR /&gt;That's because your current dir is not in the path - do it this way &lt;BR /&gt;&lt;BR /&gt;. ./run.sh&lt;BR /&gt;&lt;BR /&gt;./ tells it to look in your current dir.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
    <pubDate>Thu, 26 Aug 2004 13:26:19 GMT</pubDate>
    <dc:creator>Jeff Schussele</dc:creator>
    <dc:date>2004-08-26T13:26:19Z</dc:date>
    <item>
      <title>Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366054#M194842</link>
      <description>Hi ,&lt;BR /&gt;I have shell script(run.sh) where i set my variables like &lt;BR /&gt;--------------------------&lt;BR /&gt;PATH=/opt/bea/hom&lt;BR /&gt;CLASSPATH=/opt/bea/weblogic.jar&lt;BR /&gt;export PATH&lt;BR /&gt;export CLASSPATH&lt;BR /&gt;---------------------------&lt;BR /&gt;I do the following&lt;BR /&gt;1.sh run.sh&lt;BR /&gt;2.echo $CLASSPATH&lt;BR /&gt;&lt;BR /&gt;FOr some reasons, the one set in my shell script is not being reflected in my shell, Can  you help know where i am doing it wrong.&lt;BR /&gt;&lt;BR /&gt;Tks,&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 12:46:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366054#M194842</guid>
      <dc:creator>Nagendra_6</dc:creator>
      <dc:date>2004-08-26T12:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366055#M194843</link>
      <description>Hi Nagendra,&lt;BR /&gt;&lt;BR /&gt;You need to source the file, not run it - EX:&lt;BR /&gt;&lt;BR /&gt;. run.sh&lt;BR /&gt;&lt;BR /&gt;That way it applies to your current shell. When you run it it only applies to the shell that runs it...and then exits.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Thu, 26 Aug 2004 12:51:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366055#M194843</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-08-26T12:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366056#M194844</link>
      <description>just try,&lt;BR /&gt;&lt;BR /&gt;./run.sh&lt;BR /&gt;&lt;BR /&gt;Without the sh.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Peter</description>
      <pubDate>Thu, 26 Aug 2004 12:52:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366056#M194844</guid>
      <dc:creator>Hoefnix</dc:creator>
      <dc:date>2004-08-26T12:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366057#M194845</link>
      <description>Nagendra,&lt;BR /&gt;&lt;BR /&gt;The variables are being set in a child shell when you run # sh run.sh&lt;BR /&gt;Those variables, even if exported, are not passed back to the parent shell that ran the program.&lt;BR /&gt;&lt;BR /&gt;Instead you could do:  ./run.sh &lt;BR /&gt;&lt;BR /&gt;Jim</description>
      <pubDate>Thu, 26 Aug 2004 12:53:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366057#M194845</guid>
      <dc:creator>Jim Mallett</dc:creator>
      <dc:date>2004-08-26T12:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366058#M194846</link>
      <description>I did &lt;BR /&gt;&lt;BR /&gt;1) ./run.sh and&lt;BR /&gt;2) echo $PATH&lt;BR /&gt;&lt;BR /&gt;But the path is not being reflected :(&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 12:57:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366058#M194846</guid>
      <dc:creator>Nagendra_6</dc:creator>
      <dc:date>2004-08-26T12:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366059#M194847</link>
      <description>and if you do:&lt;BR /&gt;&lt;BR /&gt;export PATH=/opt/bea/hom&lt;BR /&gt;&lt;BR /&gt;And then do:&lt;BR /&gt;echo $PATH&lt;BR /&gt;It should reflect your PATH.&lt;BR /&gt;&lt;BR /&gt;If you try to source the file like Jeff suggest, will that work?&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Peter</description>
      <pubDate>Thu, 26 Aug 2004 13:00:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366059#M194847</guid>
      <dc:creator>Hoefnix</dc:creator>
      <dc:date>2004-08-26T13:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366060#M194848</link>
      <description>Sorry, use Jeff's solution.  I should have known because that is how I have to set my DISPLAY variable from time to time.&lt;BR /&gt;&lt;BR /&gt;Just tested it:&lt;BR /&gt;&lt;BR /&gt;. run.sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/no points please/</description>
      <pubDate>Thu, 26 Aug 2004 13:01:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366060#M194848</guid>
      <dc:creator>Jim Mallett</dc:creator>
      <dc:date>2004-08-26T13:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366061#M194849</link>
      <description>Hi try this.&lt;BR /&gt;&lt;BR /&gt;Rename the file from run.sh to .run.sh&lt;BR /&gt;chmod 666 .run.sh&lt;BR /&gt;$. ./.run.sh&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 13:08:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366061#M194849</guid>
      <dc:creator>Tanmay_1</dc:creator>
      <dc:date>2004-08-26T13:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366062#M194850</link>
      <description>No need to rename the file.&lt;BR /&gt;&lt;BR /&gt;You just need to do:&lt;BR /&gt;&lt;BR /&gt;. run.sh&lt;BR /&gt;&lt;BR /&gt;Note that there is a SPACE between the first . and the run.sh.  That is what tells the shell to apply the settings to your running shell.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 13:17:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366062#M194850</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-08-26T13:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366063#M194851</link>
      <description>Thanks for your replies.&lt;BR /&gt;&lt;BR /&gt;When i do a &lt;BR /&gt;$ . run.sh &lt;BR /&gt;&lt;BR /&gt;i get the following,&lt;BR /&gt;&lt;BR /&gt;$ su: run.sh not found.&lt;BR /&gt;&lt;BR /&gt;any idea where i could be wrong. I have the permissions..&lt;BR /&gt;&lt;BR /&gt;Tks, Nag&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Aug 2004 13:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366063#M194851</guid>
      <dc:creator>Nagendra_6</dc:creator>
      <dc:date>2004-08-26T13:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366064#M194852</link>
      <description>Just do:&lt;BR /&gt;. ./run.sh&lt;BR /&gt;&lt;BR /&gt;Your local-path is not your PATH variable so use ./ infront of it.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Peter</description>
      <pubDate>Thu, 26 Aug 2004 13:26:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366064#M194852</guid>
      <dc:creator>Hoefnix</dc:creator>
      <dc:date>2004-08-26T13:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366065#M194853</link>
      <description>Hi (again) Nagendra,&lt;BR /&gt;&lt;BR /&gt;That's because your current dir is not in the path - do it this way &lt;BR /&gt;&lt;BR /&gt;. ./run.sh&lt;BR /&gt;&lt;BR /&gt;./ tells it to look in your current dir.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Thu, 26 Aug 2004 13:26:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366065#M194853</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2004-08-26T13:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366066#M194854</link>
      <description>When you simply type the name of any shell script (or in your case, sh &amp;lt;script-name&amp;gt;, a separate child or subprocess shell is started and your script runs there. When the script ends, the sub-shell is removed and nothing is returned to the parent. What you require is called 'sourcing' and it is essentially a way to have the current shell run each of the script's steps. It is run with the smallest shell command: a period (or dot).&lt;BR /&gt; &lt;BR /&gt;Sourcing can be included in a script and in your example for WebLogic, you can source the run.sh as mentioned above with just . shell-script. This is a common way to provide shell variab;les to every user login too. Just source a script in /etc/profile and now everyone gets the env values.&lt;BR /&gt; &lt;BR /&gt;You might want to update your script to take advantage of POSIX shell features such as type and assign on one line:&lt;BR /&gt; &lt;BR /&gt;export PATH=/opt/bea/hom&lt;BR /&gt;export CLASSPATH=/opt/bea/weblogic.jar&lt;BR /&gt; &lt;BR /&gt;Also, all your shell scripts should explicitly define the shell interpreter on line 1. Just insert this as line 1:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh</description>
      <pubDate>Thu, 26 Aug 2004 13:59:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366066#M194854</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-08-26T13:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Setting my SHELL variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366067#M194855</link>
      <description>There is one other rule that you need to apply to any sourced file within a shell script. It must not contain an exit statement or a return statement (unless inside a function) because the exit or return will have the effect of exiting the foreground process --- which is probably not your intent.</description>
      <pubDate>Thu, 26 Aug 2004 19:59:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-my-shell-variables/m-p/3366067#M194855</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-08-26T19:59:14Z</dc:date>
    </item>
  </channel>
</rss>

