<?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 system variable in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288734#M886136</link>
    <description>PWD is not a system variable but its a shell variable. When you change the directory, the value for PWD changes its self. You can verify the same by doing the following on the command prompt:&lt;BR /&gt;&lt;BR /&gt;$ echo $PWD&lt;BR /&gt;/home/anshu&lt;BR /&gt;$ cd /tmp&lt;BR /&gt;$ echo $PWD&lt;BR /&gt;/tmp&lt;BR /&gt;&lt;BR /&gt;So PWD will have the current directory information until unless its changed puposely.&lt;BR /&gt;&lt;BR /&gt;More over, in your script you can always assign the value to PWD as follows:&lt;BR /&gt;&lt;BR /&gt;PWD=`pwd`&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;&lt;BR /&gt;Anshu</description>
    <pubDate>Fri, 28 May 2004 04:04:08 GMT</pubDate>
    <dc:creator>Anupam Anshu_1</dc:creator>
    <dc:date>2004-05-28T04:04:08Z</dc:date>
    <item>
      <title>Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288725#M886127</link>
      <description>How do I set a system variable, called $PWD, to the current working directory.&lt;BR /&gt;&lt;BR /&gt;It should stay defined.&lt;BR /&gt;&lt;BR /&gt;This is needed to run an application.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.</description>
      <pubDate>Thu, 27 May 2004 08:50:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288725#M886127</guid>
      <dc:creator>Scott Sabo</dc:creator>
      <dc:date>2004-05-27T08:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288726#M886128</link>
      <description>Scott,&lt;BR /&gt;&lt;BR /&gt;It is set default, as far as i know. &lt;BR /&gt;&lt;BR /&gt;if not:&lt;BR /&gt;&lt;BR /&gt;PWD=`pwd`&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Gideon&lt;BR /&gt;</description>
      <pubDate>Thu, 27 May 2004 08:56:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288726#M886128</guid>
      <dc:creator>G. Vrijhoeven</dc:creator>
      <dc:date>2004-05-27T08:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288727#M886129</link>
      <description>THe above option will only change PS1 to the directory you happen to be in at the time. Try&lt;BR /&gt;&lt;BR /&gt;export PS1="\$PWD "&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Thu, 27 May 2004 08:59:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288727#M886129</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-05-27T08:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288728#M886130</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This should work.&lt;BR /&gt;&lt;BR /&gt;# export PATH=`pwd`&lt;BR /&gt;&lt;BR /&gt;Check to see the change affected;&lt;BR /&gt;# echo $PATH&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 May 2004 09:00:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288728#M886130</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-05-27T09:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288729#M886131</link>
      <description>It is a defualt behaviour of any shell I believe .. &lt;BR /&gt;&lt;BR /&gt;You need not set it manually&lt;BR /&gt;&lt;BR /&gt;Kaps</description>
      <pubDate>Thu, 27 May 2004 09:00:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288729#M886131</guid>
      <dc:creator>KapilRaj</dc:creator>
      <dc:date>2004-05-27T09:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288730#M886132</link>
      <description>Sorry!!!&lt;BR /&gt; &lt;BR /&gt;Completely misread the question!  The other answers here are correct. &lt;BR /&gt; &lt;BR /&gt; However, $PWD is usually set by default</description>
      <pubDate>Thu, 27 May 2004 09:02:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288730#M886132</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-05-27T09:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288731#M886133</link>
      <description>Sooooooorry,&lt;BR /&gt;I got confused ... Ignore entirely my post.&lt;BR /&gt;</description>
      <pubDate>Thu, 27 May 2004 09:02:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288731#M886133</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-05-27T09:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288732#M886134</link>
      <description>'PWD' is an internally updated environment variable updated by the shell as you change directories.&lt;BR /&gt;&lt;BR /&gt;Is there a particular reason you awnt it set to the current working directory?</description>
      <pubDate>Thu, 27 May 2004 19:40:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288732#M886134</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-05-27T19:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288733#M886135</link>
      <description>L.S.&lt;BR /&gt;&lt;BR /&gt;I agree with Stuart: it is set automatically and I see no need to change it manually.&lt;BR /&gt;Check your shell's manual page. I cannot find $PWD in the sh-bourne man page (which doesn't mean PWD is not set automatically) but is is described in the sh-posix and ksh man page:&lt;BR /&gt;PWD: the present working directory set by the cd command.&lt;BR /&gt;&lt;BR /&gt;((I am not sure about the c shell (csh). I cannot find PWD in the csh manpage (?? can you check that??). If your users are using the cshell you may change it to the posix shell (ask them first if they login interactively because the shells differ a lot!) or use 'setenv PWD $cwd'. On my Linux system (no HP-UX available at this moment) csh sets my $PWD automatically.))&lt;BR /&gt;&lt;BR /&gt;What is your problem with the application?&lt;BR /&gt;If you type echo $PWD before starting the application do you see the current working directory?&lt;BR /&gt;&lt;BR /&gt;JP</description>
      <pubDate>Fri, 28 May 2004 01:20:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288733#M886135</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2004-05-28T01:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288734#M886136</link>
      <description>PWD is not a system variable but its a shell variable. When you change the directory, the value for PWD changes its self. You can verify the same by doing the following on the command prompt:&lt;BR /&gt;&lt;BR /&gt;$ echo $PWD&lt;BR /&gt;/home/anshu&lt;BR /&gt;$ cd /tmp&lt;BR /&gt;$ echo $PWD&lt;BR /&gt;/tmp&lt;BR /&gt;&lt;BR /&gt;So PWD will have the current directory information until unless its changed puposely.&lt;BR /&gt;&lt;BR /&gt;More over, in your script you can always assign the value to PWD as follows:&lt;BR /&gt;&lt;BR /&gt;PWD=`pwd`&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;&lt;BR /&gt;Anshu</description>
      <pubDate>Fri, 28 May 2004 04:04:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288734#M886136</guid>
      <dc:creator>Anupam Anshu_1</dc:creator>
      <dc:date>2004-05-28T04:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288735#M886137</link>
      <description>As said before PWD is a system variable so you do not need to set it. Just use it! &lt;BR /&gt;&lt;BR /&gt;I think you want to store the PWD value at a given time. If you want this do:&lt;BR /&gt;&lt;BR /&gt;export PWD_NOW=`pwd`;&lt;BR /&gt;&lt;BR /&gt;And you'll have it stored in PWD_NOW!</description>
      <pubDate>Fri, 28 May 2004 05:35:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288735#M886137</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2004-05-28T05:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288736#M886138</link>
      <description>Ok, it appears that the app is looking for the current directory (pwd) as set in a variable called PWD (uppercase), which is not set to anything.&lt;BR /&gt;&lt;BR /&gt;Help me, Hp-wan-kenobi...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 May 2004 07:45:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288736#M886138</guid>
      <dc:creator>Scott Sabo</dc:creator>
      <dc:date>2004-05-28T07:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288737#M886139</link>
      <description>What shell are you running?&lt;BR /&gt;PWD is set in standard Posix shell. But if you are running some other shell that may not be the case.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Trond</description>
      <pubDate>Fri, 28 May 2004 07:52:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288737#M886139</guid>
      <dc:creator>Trond Haugen</dc:creator>
      <dc:date>2004-05-28T07:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288738#M886140</link>
      <description>If you what $PWD=PS1 Global you need to place your variable definition in /etc/profile&lt;BR /&gt;&lt;BR /&gt;it Requires exporting two variables&lt;BR /&gt;&lt;BR /&gt;export PS1='$PWD' &lt;BR /&gt;export PWD=`pwd`&lt;BR /&gt;&lt;BR /&gt;this should resolve your issue.&lt;BR /&gt;&lt;BR /&gt;I generally place a "$" for not root users and "#" for root  in the &lt;BR /&gt;export PS1='$PWD' # String &lt;BR /&gt;&lt;BR /&gt;You can at this snippet into your profile to do that &lt;BR /&gt;export wai=`who am i|awk '{print $1}'`&lt;BR /&gt;&lt;BR /&gt;if [ $wai  = 'root' ]&lt;BR /&gt; then  &lt;BR /&gt;    export PS1='$PWD'"#"&lt;BR /&gt;    export PWD=`pwd`&lt;BR /&gt;      else  &lt;BR /&gt;    export PS1='$PWD'"$"&lt;BR /&gt;    export PWD=`pwd`&lt;BR /&gt; fi &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope it helps.. &lt;BR /&gt;</description>
      <pubDate>Fri, 28 May 2004 08:32:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288738#M886140</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2004-05-28T08:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288739#M886141</link>
      <description>BTW &lt;BR /&gt;&lt;BR /&gt;the snippet will work on most Un*x systems, &lt;BR /&gt;&lt;BR /&gt;I've used it on Solaris, AIX, SCO, HP/UX, DG/UX, and Linux flavors. I've not tried "Cygwin" but my guess it'd work. &lt;BR /&gt;&lt;BR /&gt;I noticed someone using PATH ??? don't forget your coffee before you write and test scripts, your wind up wandering what you did! &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 May 2004 08:40:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288739#M886141</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2004-05-28T08:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288740#M886142</link>
      <description>BTW $PWD is a variable and not general system defined it requires using the "pwd" command. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 May 2004 08:41:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288740#M886142</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2004-05-28T08:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Setting system variable</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288741#M886143</link>
      <description>If you are using ksh: export PWD=&lt;PWD_VALUE&gt;&lt;BR /&gt;If you are using csh: setenv PWD &lt;PWD_VALUE&gt;&lt;/PWD_VALUE&gt;&lt;/PWD_VALUE&gt;</description>
      <pubDate>Wed, 02 Jun 2004 10:28:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/setting-system-variable/m-p/3288741#M886143</guid>
      <dc:creator>iminus</dc:creator>
      <dc:date>2004-06-02T10:28:07Z</dc:date>
    </item>
  </channel>
</rss>

