<?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: HPUX 11.23i - process grouping and subshells in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130143#M688293</link>
    <description>Explaination above.</description>
    <pubDate>Thu, 18 Sep 2008 05:26:51 GMT</pubDate>
    <dc:creator>Rob Lindsay</dc:creator>
    <dc:date>2008-09-18T05:26:51Z</dc:date>
    <item>
      <title>HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130136#M688286</link>
      <description>&lt;!--!*#--&gt;I have a question regarding the scenario below. When grouping the sleep and the echo and putting them both in the background it produces what looks like 6 child copies of the current script running the sleeps as children. Note that if you do not group the commands and just run the sleep in the background you do not get the 6 copies and the sleeps run as children of the original script (i.e. PID 26076).&lt;BR /&gt;&lt;BR /&gt;My question is, are these actually 6 running copies of the script or are they just subshells given the name of the current script.&lt;BR /&gt;&lt;BR /&gt;Script that was run:&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;x=1&lt;BR /&gt;while [ ${x} -le 6 ]&lt;BR /&gt;do&lt;BR /&gt;( nohup sleep 10; echo ${x} ) &amp;amp;&lt;BR /&gt;x=$(expr ${x} + 1)&lt;BR /&gt;done&lt;BR /&gt;sleep 10&lt;BR /&gt;&lt;BR /&gt;Processes list while the script was running:&lt;BR /&gt;&lt;BR /&gt; systest 26090 26089  0 16:31:12 pts/19    0:00 sleep 10&lt;BR /&gt; systest 26086 26076  0 16:31:12 pts/19    0:00 /bin/sh /app/systest/runs/foo2.sh&lt;BR /&gt;    root  8777   933  0 11:11:50 ?         0:00 sshd: systest [priv]&lt;BR /&gt; systest  8909  8907  0 11:11:57 pts/19    0:00 -ksh&lt;BR /&gt; systest 26082 26080  0 16:31:12 pts/19    0:00 sleep 10&lt;BR /&gt; systest 22879 22816  0 10:43:10 ?         0:00 sshd: systest@pts/14&lt;BR /&gt; systest 26078 26077  0 16:31:12 pts/19    0:00 sleep 10&lt;BR /&gt; systest 26095 26076  0 16:31:12 pts/19    0:00 sleep 10&lt;BR /&gt; systest 26080 26076  0 16:31:12 pts/19    0:00 /bin/sh /app/systest/runs/foo2.sh&lt;BR /&gt; systest 26077 26076  0 16:31:12 pts/19    0:00 /bin/sh /app/systest/runs/foo2.sh&lt;BR /&gt; systest 26092 26076  0 16:31:12 pts/19    0:00 /bin/sh /app/systest/runs/foo2.sh&lt;BR /&gt; systest 22881 22879  0 10:43:10 pts/14    0:00 -ksh&lt;BR /&gt; systest 26076  8909  0 16:31:12 pts/19    0:00 /bin/sh /app/systest/runs/foo2.sh&lt;BR /&gt; systest 26089 26076  0 16:31:12 pts/19    0:00 /bin/sh /app/systest/runs/foo2.sh&lt;BR /&gt; systest 26088 26086  0 16:31:12 pts/19    0:00 sleep 10&lt;BR /&gt; systest  8907  8777  0 11:11:56 ?         0:01 sshd: systest@pts/19&lt;BR /&gt; systest 26104 22881  0 16:31:17 pts/14    0:00 grep systest&lt;BR /&gt; systest 26083 26076  0 16:31:12 pts/19    0:00 /bin/sh /app/systest/runs/foo2.sh&lt;BR /&gt; systest 26094 26092  0 16:31:12 pts/19    0:00 sleep 10&lt;BR /&gt; systest 26103 22881  5 16:31:17 pts/14    0:00 ps -ef&lt;BR /&gt; systest 26085 26083  0 16:31:12 pts/19    0:00 sleep 10&lt;BR /&gt;    root 22816   933  0 10:43:06 ?         0:00 sshd: systest [priv]&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Sep 2008 22:05:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130136#M688286</guid>
      <dc:creator>Rob Lindsay</dc:creator>
      <dc:date>2008-09-16T22:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130137#M688287</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;While these are subshells (children) insofar as they can't alter their parent's variables, they do inherit all of their parent's environment when initiated.  In that sense they are copies of the parent (as in 'fork' and 'exec').&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 16 Sep 2008 22:49:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130137#M688287</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-16T22:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130138#M688288</link>
      <description>Thanks JR,&lt;BR /&gt;&lt;BR /&gt;Further to my question, as far as I can see the six child processes of the original script (PID 26076) cannot actually be running copies of that script even though the COMMAND listed in ps is the same name. If they were running copies then 6 more sleeps would be forked and the script would never end ...</description>
      <pubDate>Tue, 16 Sep 2008 22:57:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130138#M688288</guid>
      <dc:creator>Rob Lindsay</dc:creator>
      <dc:date>2008-09-16T22:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130139#M688289</link>
      <description>&amp;gt;Processes list while the script was running:&lt;BR /&gt;&lt;BR /&gt;Please use the following to provide a nice indented list:&lt;BR /&gt;$ UNIX95=1 ps -H -fu systest&lt;BR /&gt;&lt;BR /&gt;You'll also need to attach it so it doesn't get reformatted.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;are these actually 6 running copies of the script or are they just subshells given the name of the current script.&lt;BR /&gt;&lt;BR /&gt;The latter.  These are subshells executing a pipeline.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;cannot actually be running copies of that script even though the COMMAND listed in ps is the same name. &lt;BR /&gt;&lt;BR /&gt;Right.  They are only executing parts of the original script but since they were forked, everything in ps(1) looks the same.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: In that sense they are copies of the parent (as in 'fork' and 'exec').&lt;BR /&gt;&lt;BR /&gt;You mean as in just "fork" and nothing else.</description>
      <pubDate>Wed, 17 Sep 2008 02:10:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130139#M688289</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-17T02:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130140#M688290</link>
      <description>Dennis, Thanks for the formatted ps output suggestion this displays heirachy well!&lt;BR /&gt;&lt;BR /&gt;A formatted and order ps list is now attached.</description>
      <pubDate>Thu, 18 Sep 2008 04:54:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130140#M688290</guid>
      <dc:creator>Rob Lindsay</dc:creator>
      <dc:date>2008-09-18T04:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130141#M688291</link>
      <description>&amp;gt;displays hierarchy well!&lt;BR /&gt;&lt;BR /&gt;This shows the 6 subshells, each with a sleep child.  And a sleep in the original shell.</description>
      <pubDate>Thu, 18 Sep 2008 05:18:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130141#M688291</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-09-18T05:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130142#M688292</link>
      <description>Yes. It is clear now what is happening.&lt;BR /&gt;&lt;BR /&gt;It is a shame ps displays these subshells with same name as their parent though, quite confusing until you find out what's going on.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help !</description>
      <pubDate>Thu, 18 Sep 2008 05:24:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130142#M688292</guid>
      <dc:creator>Rob Lindsay</dc:creator>
      <dc:date>2008-09-18T05:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: HPUX 11.23i - process grouping and subshells</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130143#M688293</link>
      <description>Explaination above.</description>
      <pubDate>Thu, 18 Sep 2008 05:26:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hpux-11-23i-process-grouping-and-subshells/m-p/5130143#M688293</guid>
      <dc:creator>Rob Lindsay</dc:creator>
      <dc:date>2008-09-18T05:26:51Z</dc:date>
    </item>
  </channel>
</rss>

