<?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: Where is PATH variable set? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881999#M849342</link>
    <description>PATH variable can be changed on /etc/PATH file, /etc/profile, $HOME/.profile that is all. And changes to that shell will not effect other shell without using the any of the three.&lt;BR /&gt;</description>
    <pubDate>Tue, 25 Jan 2005 06:08:04 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-01-25T06:08:04Z</dc:date>
    <item>
      <title>Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881994#M849337</link>
      <description>When I log in, my PATH variable has 27 different path components. Many of these, I can easily trace to things like my .profile, but others, I am having problems finding where they are set up.&lt;BR /&gt;&lt;BR /&gt;Does anyone know of a tool or have a script that will tell me where all of my PATH components are set?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gary</description>
      <pubDate>Tue, 25 Jan 2005 05:50:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881994#M849337</guid>
      <dc:creator>Gary Cooper_1</dc:creator>
      <dc:date>2005-01-25T05:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881995#M849338</link>
      <description>The default path is set in the file /etc/PATH.&lt;BR /&gt;&lt;BR /&gt;Your local profile then makes changes to this (as you've already seen).</description>
      <pubDate>Tue, 25 Jan 2005 05:52:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881995#M849338</guid>
      <dc:creator>Chris Wilshaw</dc:creator>
      <dc:date>2005-01-25T05:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881996#M849339</link>
      <description>Thanks for the reply, Chris - I'm impressed at how quickly I got a response - 2 minutes from posting! &lt;BR /&gt;&lt;BR /&gt;Unfortunately, the PATH components I'm looking for are application level paths that aren't set in /etc/profile.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gary</description>
      <pubDate>Tue, 25 Jan 2005 05:58:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881996#M849339</guid>
      <dc:creator>Gary Cooper_1</dc:creator>
      <dc:date>2005-01-25T05:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881997#M849340</link>
      <description>hi, &lt;BR /&gt; &lt;BR /&gt;options enough:&lt;BR /&gt;- /etc/PATH&lt;BR /&gt;- modified in /etc/profile&lt;BR /&gt;- modified again in $HOME.profile&lt;BR /&gt;...&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.</description>
      <pubDate>Tue, 25 Jan 2005 06:03:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881997#M849340</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2005-01-25T06:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881998#M849341</link>
      <description>/etc/profile will set PATH with script lines of,&lt;BR /&gt;&lt;BR /&gt;# Set the default paths - Do NOT modify these.&lt;BR /&gt;# Modify the variables through /etc/PATH and /etc/MANPATH&lt;BR /&gt;&lt;BR /&gt;        PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/java1.4/bin&lt;BR /&gt;        MANPATH=/usr/share/man:/usr/contrib/man:/usr/local/man&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Insure PATH contains either /usr/bin or /sbin (if /usr/bin is not available).&lt;BR /&gt;&lt;BR /&gt;        if [ ! -d /usr/sbin ]&lt;BR /&gt;        then&lt;BR /&gt;                PATH=$PATH:/sbin&lt;BR /&gt;&lt;BR /&gt;        else    if [ -r /etc/PATH ]&lt;BR /&gt;                then&lt;BR /&gt;&lt;BR /&gt;                # Insure that $PATH includes /usr/bin .  If /usr/bin is&lt;BR /&gt;                # present in /etc/PATH then $PATH is set to the contents&lt;BR /&gt;                # of /etc/PATH.  Otherwise, add the contents of /etc/PATH&lt;BR /&gt;                # to the end of the default $PATH definition above.&lt;BR /&gt;&lt;BR /&gt;                        grep -q -e "^/usr/bin$" -e "^/usr/bin:" -e ":/usr/bin:"\&lt;BR /&gt;                                -e ":/usr/bin$" /etc/PATH&lt;BR /&gt;                        if [ $? -eq 0 ]&lt;BR /&gt;                        then&lt;BR /&gt;                                PATH=`cat /etc/PATH`&lt;BR /&gt;                        else&lt;BR /&gt;                                PATH=$PATH:`cat /etc/PATH`&lt;BR /&gt;                        fi&lt;BR /&gt;                fi&lt;BR /&gt;        fi&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;BR /&gt;        export PATH&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Jan 2005 06:04:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881998#M849341</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-01-25T06:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881999#M849342</link>
      <description>PATH variable can be changed on /etc/PATH file, /etc/profile, $HOME/.profile that is all. And changes to that shell will not effect other shell without using the any of the three.&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Jan 2005 06:08:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4881999#M849342</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-01-25T06:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882000#M849343</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the system PATH is set in .profile file&lt;BR /&gt;&lt;BR /&gt;for any application you installed, it creates a directory /opt/&lt;APPLICATION name=""&gt;/bin&lt;BR /&gt;&lt;BR /&gt;open the .profile file (using vi) and at the of PATH line add the application bin path(i.e some thing like this, PATH=/sbin:/usr/bin:/opt/&lt;APPLICATION name=""&gt;/bin&lt;BR /&gt;&lt;BR /&gt;save and close the file&lt;BR /&gt;&lt;BR /&gt;logout and login again&lt;BR /&gt;&lt;/APPLICATION&gt;&lt;/APPLICATION&gt;</description>
      <pubDate>Tue, 25 Jan 2005 06:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882000#M849343</guid>
      <dc:creator>Ravi_8</dc:creator>
      <dc:date>2005-01-25T06:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882001#M849344</link>
      <description>Thanks for the very prompt responses guys.&lt;BR /&gt;&lt;BR /&gt;However what I was getting at was some sort of tool/script or debug switch that I could use which when run would (say) create a PATH log file along the lines of:&lt;BR /&gt;&lt;BR /&gt;/etc/profile:           /usr/bin&lt;BR /&gt;/etc/profile:           /usr/contrib/bin&lt;BR /&gt;/home/&lt;USER&gt;:           .&lt;BR /&gt;/opt/cgs/etc/profile:   /opt/cgs/bin&lt;BR /&gt;&lt;BR /&gt;I've now found where the part of the PATH variable that I'm interested in is set - /opt/cgs/etc/profile, so my immediate problem is over. &lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;&lt;BR /&gt;Gary&lt;/USER&gt;</description>
      <pubDate>Tue, 25 Jan 2005 06:26:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882001#M849344</guid>
      <dc:creator>Gary Cooper_1</dc:creator>
      <dc:date>2005-01-25T06:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882002#M849345</link>
      <description>Gary,&lt;BR /&gt;I think the only way you could get this list of where individual parts of the PATH are set is by doing a echo of $PATH at the beginning and end of each files (/etc/profile.../.login etc.) and comparing the differences added in each file.&lt;BR /&gt;Sorry</description>
      <pubDate>Tue, 25 Jan 2005 08:38:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882002#M849345</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-25T08:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882003#M849346</link>
      <description>The PATH variable is just another variable so any program or script can add or completely replace the PATH variable. It is quite common for some applications to add their own setup to /etc/profile, possibly in the form of a 'sourced' script (ie, . /opt/cgs/etc/profile) or even by the application itself in it's own startup script. You fastest way to find the culprit is to echo $PATH at the start of /etc/profile and $HOME/.sh_profile, and also at the end of these files. If the value was changed by the exit point, something inside the script changed it.&lt;BR /&gt; &lt;BR /&gt;I'm not a fan of long PATH variables at all. They can degrade startup performance but most important, they are a source of potential hacking. Every entry in /etc/PATH as well as any changes to $PATH should be verified that it is valid  and necessary. I've attached a script that looks at /etc/PATH and then looks at the current value of $PATH. It will put out error messages for directory paths that do not exist, current working directory, or worse, are world-writable.</description>
      <pubDate>Tue, 25 Jan 2005 08:39:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882003#M849346</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-01-25T08:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Where is PATH variable set?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882004#M849347</link>
      <description>Thanks guys.&lt;BR /&gt;&lt;BR /&gt;I must say, that's what I've done in the past - embed echo statements in .profile, etc. It is pretty cumbersome though.&lt;BR /&gt;&lt;BR /&gt;Thanks for the script Bill, I'll have a look at that.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Gary</description>
      <pubDate>Tue, 25 Jan 2005 08:53:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/where-is-path-variable-set/m-p/4882004#M849347</guid>
      <dc:creator>Gary Cooper_1</dc:creator>
      <dc:date>2005-01-25T08:53:22Z</dc:date>
    </item>
  </channel>
</rss>

