<?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 Environment Variables in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076608#M730147</link>
    <description>Dear Gurus,&lt;BR /&gt;&lt;BR /&gt;whats the difference between ` &amp;amp; ' in variables &amp;amp; how do i set my shell prompt to show hostname and present working directory.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Dinesh</description>
    <pubDate>Sat, 27 Oct 2007 01:10:13 GMT</pubDate>
    <dc:creator>Din_1</dc:creator>
    <dc:date>2007-10-27T01:10:13Z</dc:date>
    <item>
      <title>Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076608#M730147</link>
      <description>Dear Gurus,&lt;BR /&gt;&lt;BR /&gt;whats the difference between ` &amp;amp; ' in variables &amp;amp; how do i set my shell prompt to show hostname and present working directory.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Dinesh</description>
      <pubDate>Sat, 27 Oct 2007 01:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076608#M730147</guid>
      <dc:creator>Din_1</dc:creator>
      <dc:date>2007-10-27T01:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076609#M730148</link>
      <description>Din,&lt;BR /&gt;&lt;BR /&gt;insert this line in your .profile&lt;BR /&gt;&lt;BR /&gt;PS1=`hostname`:'$PWD'#&lt;BR /&gt;export PS1&lt;BR /&gt;&lt;BR /&gt;show hostname and present working directory&lt;BR /&gt;&lt;BR /&gt;Fat</description>
      <pubDate>Sat, 27 Oct 2007 01:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076609#M730148</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-27T01:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076610#M730149</link>
      <description>Dinesh,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For more information about shell and vars. anv see this guide:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.phys.ualberta.ca/~gingrich/research/shells/shells.html" target="_blank"&gt;http://www.phys.ualberta.ca/~gingrich/research/shells/shells.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Fat</description>
      <pubDate>Sat, 27 Oct 2007 01:56:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076610#M730149</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-27T01:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076611#M730150</link>
      <description>Hi Fat,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. I want to know when commands inserted between the ` characters its being executed and we are getting the output. As well as why the same character is not being used to get the output of PWD in this location.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Din</description>
      <pubDate>Sat, 27 Oct 2007 02:54:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076611#M730150</guid>
      <dc:creator>Din_1</dc:creator>
      <dc:date>2007-10-27T02:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076612#M730151</link>
      <description>Dinesh,&lt;BR /&gt;&lt;BR /&gt;in a shell script you can capture the output of the command in these ways:&lt;BR /&gt;&lt;BR /&gt;VAR=`hostname`&lt;BR /&gt;or&lt;BR /&gt;VAR=$(hostname)&lt;BR /&gt;&lt;BR /&gt;In a command script you use a command between `hostname` the shell try to exec not the command but its output&lt;BR /&gt;&lt;BR /&gt;From command line try to exec `hostname` and see what error appears.&lt;BR /&gt;&lt;BR /&gt;For create a PS1 var, in your case, must be execute a command to show the hostname, and an env var to show the current directory.&lt;BR /&gt;&lt;BR /&gt;PS1=`hostname`:'$PWD'#&lt;BR /&gt;&lt;BR /&gt;Fat&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Sat, 27 Oct 2007 03:52:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076612#M730151</guid>
      <dc:creator>Fat Scrape</dc:creator>
      <dc:date>2007-10-27T03:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076613#M730152</link>
      <description>Hi Dinesh,&lt;BR /&gt;&lt;BR /&gt;nowadays you will often see the newer standard:&lt;BR /&gt;$(command)&lt;BR /&gt; instead of&lt;BR /&gt;`command`&lt;BR /&gt;&lt;BR /&gt;However, the result is the same; commands in between are always executed/processed, e.g.&lt;BR /&gt;&lt;BR /&gt;$ echo $(date +%a)&lt;BR /&gt;or&lt;BR /&gt;$ echo `date +%a`&lt;BR /&gt;&lt;BR /&gt;in the example the date command is executed first and the echo command then displays the result.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In contrast, you can display the current value of a variable by just echoing it, e.g.:&lt;BR /&gt;&lt;BR /&gt;echo "$PWD"&lt;BR /&gt;&lt;BR /&gt;notice the use of double quotes, as one significant difference between single and double quotes is that any character in between single quotes is taken literally, e.g.:&lt;BR /&gt;&lt;BR /&gt;echo '$PWD'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and a bit simplified you can say that the difference between single/double quotes and back quotes/$() is that using single/double quotes does not impose any processing on the string in between; you simply display the current content.&lt;BR /&gt;But the back quoutes/$() causes command execution of whatever in between. &lt;BR /&gt;&lt;BR /&gt;However, PWD is a special variable because the shell supplies the content of it; the content is updated every time you change directory, e.g.:&lt;BR /&gt;$ echo $PWD&lt;BR /&gt;/home/john&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;you can change the content&lt;BR /&gt;$ PWD="hoooops"&lt;BR /&gt;$ echo $PWD&lt;BR /&gt;hoooops&lt;BR /&gt;&lt;BR /&gt;but the shell will overrule it when you change directory&lt;BR /&gt;&lt;BR /&gt;$ cd&lt;BR /&gt;echo $PWD&lt;BR /&gt;/home/john&lt;BR /&gt;&lt;BR /&gt;So what may be confusing in contrast to a "non reserved, home made" variable is that the content of PWD is automatically updated by the shell.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Sat, 27 Oct 2007 04:06:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076613#M730152</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2007-10-27T04:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076614#M730153</link>
      <description>Thank you very much friends,&lt;BR /&gt;&lt;BR /&gt;I was having bit confusion on this subject. Now its got cleared.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Dinesh</description>
      <pubDate>Sat, 27 Oct 2007 04:21:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076614#M730153</guid>
      <dc:creator>Din_1</dc:creator>
      <dc:date>2007-10-27T04:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Environment Variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076615#M730154</link>
      <description>Thank you very much friends,&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 27 Oct 2007 04:21:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/environment-variables/m-p/5076615#M730154</guid>
      <dc:creator>Din_1</dc:creator>
      <dc:date>2007-10-27T04:21:59Z</dc:date>
    </item>
  </channel>
</rss>

