<?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 Env Params in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655407#M922271</link>
    <description>I have a program that needs certain env params to run (for example in this question I'll use "path"). During installation, it adds a line to the .login file stating set path = ( /a/b /c/d $path ). The problem is that sometimes the path was already defined with the "/c/d" directories before that line, therefore the path value will be path=/a/b /c/d /c/d.&lt;BR /&gt;I don't want this duplicity (there's the length limit besides it's not nice...).&lt;BR /&gt;Any ideas how to solve this mess (on unix in general)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shachar</description>
    <pubDate>Wed, 30 Jan 2002 11:47:48 GMT</pubDate>
    <dc:creator>Shachar Twito_1</dc:creator>
    <dc:date>2002-01-30T11:47:48Z</dc:date>
    <item>
      <title>Env Params</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655407#M922271</link>
      <description>I have a program that needs certain env params to run (for example in this question I'll use "path"). During installation, it adds a line to the .login file stating set path = ( /a/b /c/d $path ). The problem is that sometimes the path was already defined with the "/c/d" directories before that line, therefore the path value will be path=/a/b /c/d /c/d.&lt;BR /&gt;I don't want this duplicity (there's the length limit besides it's not nice...).&lt;BR /&gt;Any ideas how to solve this mess (on unix in general)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shachar</description>
      <pubDate>Wed, 30 Jan 2002 11:47:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655407#M922271</guid>
      <dc:creator>Shachar Twito_1</dc:creator>
      <dc:date>2002-01-30T11:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Env Params</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655408#M922272</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can test if your env variable already contains the new value with a simple script like this:&lt;BR /&gt;&lt;BR /&gt;ADDPATH=YES&lt;BR /&gt;for i in `echo $PATH | tr ':' ' '`&lt;BR /&gt;do&lt;BR /&gt;  [ "$i" = "$NEWPATH" ] &amp;amp;&amp;amp; ADDPATH=NO&lt;BR /&gt;done&lt;BR /&gt;[ "$ADDPATH" = "YES" ] &amp;amp;&amp;amp; PATH=$PATH:$NEWPATH&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Ruediger</description>
      <pubDate>Wed, 30 Jan 2002 12:03:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655408#M922272</guid>
      <dc:creator>Ruediger Noack</dc:creator>
      <dc:date>2002-01-30T12:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Env Params</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655409#M922273</link>
      <description>Hi Shachar,&lt;BR /&gt;&lt;BR /&gt;How about this:&lt;BR /&gt;&lt;BR /&gt;if $a contains the directory you're interested in:&lt;BR /&gt;&lt;BR /&gt;echo $path | tr ' ' '\012' | grep -q -x $a || set path = ( $path $a )&lt;BR /&gt;&lt;BR /&gt;will only add $a if it's not already there.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 30 Jan 2002 12:19:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655409#M922273</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-01-30T12:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Env Params</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655410#M922274</link>
      <description>Thank you all for the answers.&lt;BR /&gt;Robin,&lt;BR /&gt;Does this line will work in any shell (sh, sh, tcsh, ksh...), and will it work on sun?&lt;BR /&gt;Shachar</description>
      <pubDate>Thu, 31 Jan 2002 08:19:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655410#M922274</guid>
      <dc:creator>Shachar Twito_1</dc:creator>
      <dc:date>2002-01-31T08:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Env Params</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655411#M922275</link>
      <description>Hi Shachar,&lt;BR /&gt;&lt;BR /&gt;The example I gave was for a csh.  For sh/ksh, you'll need something like:&lt;BR /&gt;&lt;BR /&gt;echo $PATH | tr : '\012' | grep -q -x $a || PATH=$PATH:$a;export PATH&lt;BR /&gt;&lt;BR /&gt;For Sun, you'll have to use /usr/xpg4/bin/grep, since this supports the -q/-x switches.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin.</description>
      <pubDate>Thu, 31 Jan 2002 09:00:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/env-params/m-p/2655411#M922275</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-01-31T09:00:48Z</dc:date>
    </item>
  </channel>
</rss>

