<?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: Determinig the environment of a process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443419#M707941</link>
    <description>"lsof" can tell you the open files as well as the current working directory.&lt;BR /&gt; &lt;BR /&gt;Again it is a third party. (but in the *nix world building and sharing tools is a way of life...)&lt;BR /&gt; &lt;BR /&gt;I vote for- processes&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
    <pubDate>Tue, 14 Dec 2004 12:12:21 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2004-12-14T12:12:21Z</dc:date>
    <item>
      <title>Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443416#M707938</link>
      <description>Hi,&lt;BR /&gt; &lt;BR /&gt;on Linux I can do something like&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;JOB=sleeper sleep 10 &amp;amp; tr \\0 \\012 [1] 5449&lt;BR /&gt;JOB=sleeper&lt;BR /&gt; &lt;BR /&gt;to access a process' environment,&lt;BR /&gt;thanks to the procfs.&lt;BR /&gt; &lt;BR /&gt;I miss this in HP-UX.&lt;BR /&gt;Or is there another way to introspect a process'es environment by HP-UX vanilla tools&lt;BR /&gt;(i.e. no tusc or other third-party tool)?&lt;BR /&gt; &lt;BR /&gt;p.s.&lt;BR /&gt;Btw, what's the Saxon Genitive for words ending on "s" like process?&lt;BR /&gt;Is it process'&lt;BR /&gt;or process's&lt;BR /&gt;or process'es&lt;BR /&gt;?</description>
      <pubDate>Tue, 14 Dec 2004 11:31:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443416#M707938</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-12-14T11:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443417#M707939</link>
      <description>Are you looking at getting the environment details of a running process??&lt;BR /&gt;If yes, there was a utility (some postsde on forums) procstat. That may help you.&lt;BR /&gt;&lt;BR /&gt;As you must be aware, for determining the environment for a process, that will be run, you can do env, set before actually starting it.&lt;BR /&gt;&lt;BR /&gt;And it is processes - I think.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Tue, 14 Dec 2004 11:37:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443417#M707939</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-12-14T11:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443418#M707940</link>
      <description>"Btw, what's the Saxon Genitive for words ending on "s" like process?"&lt;BR /&gt;&lt;BR /&gt;An interesting way to phrase the question!&lt;BR /&gt;&lt;BR /&gt;Either process' or process's would be appropriate.  The former used to be exclusivily prefered 20-25 years ago, but the latter is now acceptible.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Dec 2004 11:48:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443418#M707940</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2004-12-14T11:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443419#M707941</link>
      <description>"lsof" can tell you the open files as well as the current working directory.&lt;BR /&gt; &lt;BR /&gt;Again it is a third party. (but in the *nix world building and sharing tools is a way of life...)&lt;BR /&gt; &lt;BR /&gt;I vote for- processes&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 14 Dec 2004 12:12:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443419#M707941</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-12-14T12:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443420#M707942</link>
      <description>Hmmm....Saxon Genitive is a new term for me.  For those not familiar with its meaning, it is the possessive form of a word.&lt;BR /&gt;&lt;BR /&gt;In this case, the possessive of process is, I think, process'.&lt;BR /&gt;&lt;BR /&gt;The plural form of process is processes.</description>
      <pubDate>Tue, 14 Dec 2004 12:49:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443420#M707942</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-12-14T12:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443421#M707943</link>
      <description>Hmmm....It appears that to be grammatically correct the possessive of process is process's.&lt;BR /&gt;&lt;BR /&gt;For more information on all of this, try this link:&lt;BR /&gt;&lt;A href="http://www.grammarmudge.cityslide.com/articles/article/426348/4944.htm" target="_blank"&gt;http://www.grammarmudge.cityslide.com/articles/article/426348/4944.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;**Nothing like an English grammar lesson in the middle of a technical forum**</description>
      <pubDate>Tue, 14 Dec 2004 12:52:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443421#M707943</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-12-14T12:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443422#M707944</link>
      <description>Anil,&lt;BR /&gt; &lt;BR /&gt;thanks for pointing me to procstat.&lt;BR /&gt;I found a project page at &lt;A href="http://freshmeat.net/projects/procstat/" target="_blank"&gt;http://freshmeat.net/projects/procstat/&lt;/A&gt;&lt;BR /&gt;I will install this tool first on a test box to see if it satisfies my needs.&lt;BR /&gt;  &lt;BR /&gt;A pitty that HP-UX hasn't an interface similar to /proc on Linux and Solaris.&lt;BR /&gt;Wish Dietmar Konermann c/o HP would read this thread.&lt;BR /&gt;Then he could also take this topic on the wish list for future HP-UX releases.&lt;BR /&gt;He was so graceful to take up my uttered disappointment in another thread about the lack of a loopback filesystem (that lets one mount filesystem/image files) in HP-UX, and officially tag it as request for realization.&lt;BR /&gt; &lt;BR /&gt;Mark,&lt;BR /&gt; &lt;BR /&gt;the first version (viz. process') is I think what I learned in primary school.&lt;BR /&gt;This also accords to your epochal classification because that was some 30 years ago.&lt;BR /&gt; &lt;BR /&gt;Rodney,&lt;BR /&gt; &lt;BR /&gt;we have lsof already installed on quite a few boxes (an indispensible tool).&lt;BR /&gt;But I haven't found from lsof's manpage any reference or switch to getting a process' environment displayed.&lt;BR /&gt;The only references to environment relate to LSOFDEVICECACHE which is an environment variable that could point to an alternative place of a caching file.&lt;BR /&gt; &lt;BR /&gt;Patrick,&lt;BR /&gt; &lt;BR /&gt;I would bet that the term Saxon Genitive isn't familiar to most native English speakers.&lt;BR /&gt;Probably it's only an artificial nomenclature that they taught kids in German schools ;-)&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Dec 2004 04:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443422#M707944</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-12-15T04:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443423#M707945</link>
      <description>Ralph,&lt;BR /&gt;&lt;BR /&gt;There is a utility as gcore. This creates&lt;BR /&gt;the core image of the running process. May be this will help you. You will have to install two patches to get this.&lt;BR /&gt;&lt;BR /&gt;gcore -p "pid" -o "object_specifier"&lt;BR /&gt;&lt;BR /&gt;PHKL_31876&lt;BR /&gt;PHCO_32173&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 15 Dec 2004 11:12:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443423#M707945</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-12-15T11:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443424#M707946</link>
      <description>Anil,&lt;BR /&gt; &lt;BR /&gt;since I had to defer the building of procstat until now I have only yet realized that this is reading its information from a Linux procfs and thus will only run on a Linux kernel :-(&lt;BR /&gt;  &lt;BR /&gt;  &lt;BR /&gt;# cat README &lt;BR /&gt;Apr 26, 2000&lt;BR /&gt; &lt;BR /&gt;Released under the GPL.&lt;BR /&gt; &lt;BR /&gt;procstat reads statistics from /proc/&lt;PID&gt;/* for a process. It will tell you;&lt;BR /&gt;what files it has open, what sockets it has open, what address space it is&lt;BR /&gt;using, it's cwd, it's root dir, shell environment variables, or give quick,&lt;BR /&gt;short statistics about it.&lt;BR /&gt; &lt;BR /&gt;This has only been tested in linux kernel 2.2.x and may or may not work in&lt;BR /&gt;earlier or development versions of the kernel. It will only work with linux.&lt;BR /&gt; &lt;BR /&gt;This is the initial release.&lt;BR /&gt;&lt;/PID&gt;</description>
      <pubDate>Tue, 21 Dec 2004 05:18:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443424#M707946</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-12-21T05:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443425#M707947</link>
      <description>Ralph,&lt;BR /&gt; &lt;BR /&gt;the functionality you are searching for is not available in vanilla HP-UX. However, since this is an user land issue, You could attach to the running process using a debugger and then have a look at its "environ" array of strings.&lt;BR /&gt; &lt;BR /&gt;BTW, for submitting official enhancement requests you should contact your local HP Response Center.  All I did in the previous thread was posting an ID for an *existing* request.&lt;BR /&gt; &lt;BR /&gt;Best regards...&lt;BR /&gt;Dietmar.</description>
      <pubDate>Tue, 21 Dec 2004 07:19:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443425#M707947</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2004-12-21T07:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443426#M707948</link>
      <description>Hi Dietmar,&lt;BR /&gt; &lt;BR /&gt;your hint towards attaching to a running proc with a debugger sounds very promissing to me.&lt;BR /&gt;However not being a C hacker I lack mastery of the adb (I take I can use it for this purpose), and hence a liitle more help.&lt;BR /&gt;From adb's manpage I see that I could use -P switch to attach to a PID.&lt;BR /&gt;If I recall my embryonic C knowledge the main function gets as first two args the arc (argument count) and an **argv (argument array), and optionally an **env (environment array).&lt;BR /&gt;The latter I think can be fetched by the syscall getenv().&lt;BR /&gt;So it would be great if there was some sort of debugger getenv() call.&lt;BR /&gt;On the other hand I thought in order to fetch symbols from an object file (or proc/executable) that binary must have been compiled with an option that reserves memomry for the symbols as well, and that this would almost never be done on a final program release past the debugging stage because of waste of memory, right?&lt;BR /&gt;So will there be a chance at all to fetch environment variables from a non-debug-built binary?&lt;BR /&gt;But even if the binary provided symbol tables how would I have to invoke, say the adb debugger, to get the contents of environment variables displayed (i.e. which adb commands, typing, formatting etc.)?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Dec 2004 08:46:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443426#M707948</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-12-21T08:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443427#M707949</link>
      <description>Em, forgot,&lt;BR /&gt;what the hack is my local HP Response Centre?&lt;BR /&gt;I can't believe it's the Berlin HP subsidiary.&lt;BR /&gt;Thought all vital design and coding decissions were made in Hanover Street anyway?</description>
      <pubDate>Tue, 21 Dec 2004 08:53:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443427#M707949</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-12-21T08:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443428#M707950</link>
      <description>Maybe its not local, but if you have a software contract you can call A HP Response center or do an online case on this issue.&lt;BR /&gt;&lt;BR /&gt;I don't know how that would be done in Berlin.&lt;BR /&gt;&lt;BR /&gt;I am very interested in this issue because being able to determine the environment of a process after or while its running.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 21 Dec 2004 09:18:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443428#M707950</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-12-21T09:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443429#M707951</link>
      <description>Hi Steven,&lt;BR /&gt; &lt;BR /&gt;we do have support contracts to issue HP support cases over a countrywide hotline.&lt;BR /&gt;Probably I should ask them, or browse a bit through ITRC.&lt;BR /&gt; &lt;BR /&gt;To pick up the thread,&lt;BR /&gt;Dietmar has mailed me a hack meanwile that seems to apply to gdb.&lt;BR /&gt;Unfortunately I have installed gdb on only one (other) HP-UX box.&lt;BR /&gt;But I will try there.&lt;BR /&gt;This hack looks to me a bit of a mixture between shell scripting and C (viz. thingies that look like C type casts to me).&lt;BR /&gt;It seems to be a sort of gsb scripting dialect.&lt;BR /&gt;I'm sure it would make more sense to you,&lt;BR /&gt;although it's easy to gather.&lt;BR /&gt;Maybe Dietmar was so kind to also post this hack here for the community.&lt;BR /&gt;(then I could also thank him with some points ;-)</description>
      <pubDate>Tue, 21 Dec 2004 09:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443429#M707951</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-12-21T09:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Determinig the environment of a process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443430#M707952</link>
      <description>Ralph,&lt;BR /&gt;&lt;BR /&gt;your "local HP Response Center" is the German one, located in Ratingen.&lt;BR /&gt;&lt;BR /&gt;For enhancements you should go the official way (which is logging a call with the repsonse center for that) since the request should also contain information about business impact/opportunities and your support level to get the desired drive. ;-)&lt;BR /&gt;&lt;BR /&gt;For the technical background... an exec'ed process gets its enviroment as "an null-terminated array of character pointers to null-terminated strings" (man exec(2)).&lt;BR /&gt;&lt;BR /&gt;For 32bit processes this gdb script usually works (no guarantee!):&lt;BR /&gt;&lt;BR /&gt;# env32.gdb&lt;BR /&gt;set $start=*0x40001000&lt;BR /&gt;set $i=$start+4&lt;BR /&gt;printf "\nCommand Line:\n"&lt;BR /&gt;while *$i != $start&lt;BR /&gt;set $i=$i+4&lt;BR /&gt;end&lt;BR /&gt;while *$i != 0&lt;BR /&gt;x/s *$i&lt;BR /&gt;set $i=$i+4&lt;BR /&gt;end&lt;BR /&gt;set $i=$i+4&lt;BR /&gt;printf "\nEnvironment:\n"&lt;BR /&gt;while *$i != 0&lt;BR /&gt;x/s *$i&lt;BR /&gt;set $i=$i+4&lt;BR /&gt;end&lt;BR /&gt;q&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For 64bit processes try this script instead:&lt;BR /&gt;&lt;BR /&gt;# env64.gdb&lt;BR /&gt;printf "\nCommand Line:\n"&lt;BR /&gt;set $i=0&lt;BR /&gt;while ((char **)__argv)[$i] != 0&lt;BR /&gt;print ((char **)__argv)[$i]&lt;BR /&gt;set $i=$i+1&lt;BR /&gt;end&lt;BR /&gt;printf "\nEnvironment:\n"&lt;BR /&gt;set $i=0&lt;BR /&gt;while ((char **)__envp)[$i] != 0&lt;BR /&gt;print ((char **)__envp)[$i]&lt;BR /&gt;set $i=$i+1&lt;BR /&gt;end &lt;BR /&gt;q&lt;BR /&gt;&lt;BR /&gt;To call gdb with a script file, e.g. env32.gdb:&lt;BR /&gt;&lt;BR /&gt;# gdb -x env32.gdb &lt;PROGRAM&gt; &lt;PID&gt;&lt;BR /&gt;&lt;BR /&gt;No guarantee for all that stuff.&lt;BR /&gt;&lt;BR /&gt;Best regards...&lt;BR /&gt;Dietmar.&lt;BR /&gt;&lt;/PID&gt;&lt;/PROGRAM&gt;</description>
      <pubDate>Tue, 21 Dec 2004 10:34:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determinig-the-environment-of-a-process/m-p/3443430#M707952</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2004-12-21T10:34:26Z</dc:date>
    </item>
  </channel>
</rss>

