<?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: obtaining environment variables for any process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433754#M4086</link>
    <description>since when ever a process is started by a user, the process gets the default environment variables from the user home directory file .kshrc for ksh and .cshrc for csh. May be you can get the process owner and look for these files for the process environment. I know this will not apply for the cases where the environment for a process is set after it has read from .kshrc/.cshrc file</description>
    <pubDate>Tue, 01 Aug 2000 06:25:40 GMT</pubDate>
    <dc:creator>Manju Kampli</dc:creator>
    <dc:date>2000-08-01T06:25:40Z</dc:date>
    <item>
      <title>obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433747#M4079</link>
      <description>I would like to obtain the environment variables for another process.  Ideally this would be done by providing the PID of any running process, and getting the environment variables back.&lt;BR /&gt;&lt;BR /&gt;It is easy to get the environment variables for the current process, but I have been unable to figure out a way to get this information for another process.&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated :-)&lt;BR /&gt;&lt;BR /&gt;Thanks :-)</description>
      <pubDate>Mon, 31 Jul 2000 15:42:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433747#M4079</guid>
      <dc:creator>David Calkins</dc:creator>
      <dc:date>2000-07-31T15:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433748#M4080</link>
      <description>Take a look at printenv. Use it when a process executes and write contents to a file.  The env comamnd will allow you to do the same and also edit the environment on-the-fly.&lt;BR /&gt;&lt;BR /&gt;Tony</description>
      <pubDate>Mon, 31 Jul 2000 15:48:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433748#M4080</guid>
      <dc:creator>Anthony deRito</dc:creator>
      <dc:date>2000-07-31T15:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433749#M4081</link>
      <description>The commands you mentioned work on the current process :-( Not another process.  I need to be able to get the environment variables for another process.</description>
      <pubDate>Mon, 31 Jul 2000 16:30:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433749#M4081</guid>
      <dc:creator>David Calkins</dc:creator>
      <dc:date>2000-07-31T16:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433750#M4082</link>
      <description>Hello, David. &lt;BR /&gt;&lt;BR /&gt;Sorry I cannot help. However, you may get more hits from this forum if you state what you are trying to accomplish. &lt;BR /&gt;&lt;BR /&gt;Tony</description>
      <pubDate>Mon, 31 Jul 2000 16:36:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433750#M4082</guid>
      <dc:creator>Anthony deRito</dc:creator>
      <dc:date>2000-07-31T16:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433751#M4083</link>
      <description>My goal is as follows:  I have a whole set of processes.  I can easily obtain the PIDs for them.  What I would like is to know the values of certain environment variables as seen by these individual processes.  If I know this, I can then pick out all the processes that have a certain value for a given variable.&lt;BR /&gt;&lt;BR /&gt;For example, the DISPLAY variable.  Suppose I wanted to pull out all processes with a certain value for the DISPLAY variable.&lt;BR /&gt;&lt;BR /&gt;So, this is why I would like to access the environment variables for another process.&lt;BR /&gt;&lt;BR /&gt;Thanks for your replies :-)</description>
      <pubDate>Mon, 31 Jul 2000 17:35:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433751#M4083</guid>
      <dc:creator>David Calkins</dc:creator>
      <dc:date>2000-07-31T17:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433752#M4084</link>
      <description>Hi David,&lt;BR /&gt;&lt;BR /&gt;I don't know a way to get environment variables of processes, but if you do a &lt;BR /&gt;who -R&lt;BR /&gt;you get the IP-adresses of the terminals where users login from&lt;BR /&gt;If you match the tty and pts names of the users with the tty and pts names of the ps -ef output, you may get what you want.&lt;BR /&gt;&lt;BR /&gt;Regard, Andre</description>
      <pubDate>Tue, 01 Aug 2000 05:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433752#M4084</guid>
      <dc:creator>Andre van der Laarse</dc:creator>
      <dc:date>2000-08-01T05:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433753#M4085</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You might try the pstat_getproc(2) call. It retrieves information about one or more processes from the kernel structures.&lt;BR /&gt;&lt;BR /&gt;I don't have a HP-UX server at hand right now, so I can't exactly tell what kind of information it retrieves. You should have a look at the pst_status struct in /usr/include/sys/pstat.h&lt;BR /&gt;&lt;BR /&gt;The manpage for pstat contains examples on how to use the series of system calls.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Rik.</description>
      <pubDate>Tue, 01 Aug 2000 05:39:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433753#M4085</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2000-08-01T05:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433754#M4086</link>
      <description>since when ever a process is started by a user, the process gets the default environment variables from the user home directory file .kshrc for ksh and .cshrc for csh. May be you can get the process owner and look for these files for the process environment. I know this will not apply for the cases where the environment for a process is set after it has read from .kshrc/.cshrc file</description>
      <pubDate>Tue, 01 Aug 2000 06:25:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433754#M4086</guid>
      <dc:creator>Manju Kampli</dc:creator>
      <dc:date>2000-08-01T06:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433755#M4087</link>
      <description>Hi David,&lt;BR /&gt;&lt;BR /&gt;Can you give a better example of what you need to do?&lt;BR /&gt;I dont think that you can do what you need to, unless you are running something like screens, which allows connects and re-connects to the same tty, but can not give any work arounds without more information.&lt;BR /&gt;&lt;BR /&gt;I.E.&lt;BR /&gt;I have used my own scripts for tracking things.  I.E.  A user running certain programs.  I re-name the program, and create a script which launches the program, but only after logging the username, date, time, environment, etc....The log is mailed to me, or dumped to the system, and the user never knows the better :)&lt;BR /&gt;Best regards&lt;BR /&gt;Shannon</description>
      <pubDate>Tue, 01 Aug 2000 16:25:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433755#M4087</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2000-08-01T16:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433756#M4088</link>
      <description>I can't think of a way to give you the 'ideal' situation you mention, but if you have the authority to cause changes to be made to all .profile files -- I can recommend a 'jury-rig' method.&lt;BR /&gt;&lt;BR /&gt;Basically, if you were to add a line to each .profile to echo the current environment (env, set, etc.) to a file, this file could be examined for the environment.&lt;BR /&gt;&lt;BR /&gt;Also, if you have even more control over your machine &amp;amp; users -- you could even set up a script to be used instead of the "export" command.  This script would echo all new exported environment variables to the user's 'environment' file (created per the previous paragraph) before it actually exported the environment variable.&lt;BR /&gt;&lt;BR /&gt;I don't know if this would be worth your while or give you what you need -- but, it is an option.</description>
      <pubDate>Wed, 02 Aug 2000 14:03:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433756#M4088</guid>
      <dc:creator>Douglas Nakamoto</dc:creator>
      <dc:date>2000-08-02T14:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: obtaining environment variables for any process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433757#M4089</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;when a user logs is depends on what shell they are using for example ksh , if there is an /etc/profile that runs first and the if there is a local .profile that runs. Environment variables maybe set within these profiles , for specific users or a global entry depends which profile you are running.&lt;BR /&gt;&lt;BR /&gt;One way you can check the environment variables is in the users profile before the application is started put in a sh ( indicates go to shell) and then typer in env&lt;BR /&gt;this will list environment variables set for that particular user ..&lt;BR /&gt;&lt;BR /&gt;hope this helps&lt;BR /&gt;&lt;BR /&gt;Dev</description>
      <pubDate>Wed, 02 Aug 2000 14:27:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/obtaining-environment-variables-for-any-process/m-p/2433757#M4089</guid>
      <dc:creator>Devbinder Singh Marway</dc:creator>
      <dc:date>2000-08-02T14:27:08Z</dc:date>
    </item>
  </channel>
</rss>

