<?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: why could not find process? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827186#M100473</link>
    <description>Jonathan, you are right , I can grep sleep 32. I just don't understand why can not grep&lt;BR /&gt;timer.sh  &lt;BR /&gt;   what is the diference betwen  ksh and #!/bin/ksh?&lt;BR /&gt;   if  I use #!/bin/ksh , it seem that I can grep ./timer.sh ?&lt;BR /&gt;    &lt;BR /&gt;    we have servral programs , all exex like&lt;BR /&gt;this :&lt;BR /&gt;    ksh&lt;BR /&gt;    program1 $&lt;BR /&gt;    exit&lt;BR /&gt;    ksh&lt;BR /&gt;    program2 $&lt;BR /&gt;    exit&lt;BR /&gt;    I donot know why they exec like this.&lt;BR /&gt;     can I exec them like this? :&lt;BR /&gt;    #!/bin/ksh&lt;BR /&gt;    program1 $&lt;BR /&gt;     program2 $&lt;BR /&gt;     exit&lt;BR /&gt;thanks a  lot&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 21 Jul 2006 02:52:51 GMT</pubDate>
    <dc:creator>faust2008</dc:creator>
    <dc:date>2006-07-21T02:52:51Z</dc:date>
    <item>
      <title>why could not find process?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827183#M100470</link>
      <description>Hi , export,&lt;BR /&gt;   &lt;BR /&gt;    My platform is hp 11i.&lt;BR /&gt;    I user timer.sh to start a program timer 热repeatly. the content  of timer.sh is:&lt;BR /&gt;&lt;BR /&gt;while(true)&lt;BR /&gt;do&lt;BR /&gt;   if [ "`ps -ef|grep './timer '|grep -v grep`" = "" ]&lt;BR /&gt;   then&lt;BR /&gt;        ./timer IBSS2  WSNADRR=//132.97.9.71:2888  &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;        sleep 32&lt;BR /&gt;   else&lt;BR /&gt;       sleep 32&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;    &lt;BR /&gt;     I start timer.sh in this way:&lt;BR /&gt;        ksh&lt;BR /&gt;        timer.sh &amp;amp;&lt;BR /&gt;        exit&lt;BR /&gt;     but when I use ps -fe|grep timer.sh , &lt;BR /&gt;I find nothing ,I think the  timer.sh should stay alive all the time. in fact the timer  exec repeatly.&lt;BR /&gt;    can anyone tell me why ?&lt;BR /&gt;thx a lot &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Jul 2006 04:52:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827183#M100470</guid>
      <dc:creator>faust2008</dc:creator>
      <dc:date>2006-07-20T04:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: why could not find process?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827184#M100471</link>
      <description>Does your program (timer) start manually? Also, you check check if a processes is running or not by sending signal 0 to it.&lt;BR /&gt;&lt;BR /&gt;Also, whay all that grep? If you know process name (exact process name), then you can do as follows.&lt;BR /&gt;&lt;BR /&gt;proc_pid=$(UNIX95= ps -C "timer" -o pid|grep -v 'PID)&lt;BR /&gt;&lt;BR /&gt;kill -o ${proc_pid} || "start_your_program"&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Jul 2006 05:03:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827184#M100471</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-07-20T05:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: why could not find process?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827185#M100472</link>
      <description>Does timer.sh invoke a new shell (ie. #!/bin/ksh)?&lt;BR /&gt;&lt;BR /&gt;If not, it will just execute the contents of the script and not show the script name in a process list. If you do a ps -fe | grep sleep I bet you'll see your sleep 32 processes there.&lt;BR /&gt;&lt;BR /&gt;$cat timer.sh&lt;BR /&gt;while(true)&lt;BR /&gt;do&lt;BR /&gt;        sleep 5&lt;BR /&gt;done&lt;BR /&gt;$./timer.sh &amp;amp;&lt;BR /&gt;[1]     13012&lt;BR /&gt;$ps -ef | grep timer&lt;BR /&gt;  fifejj 13016 12414  0 11:23:59 pts/ta    0:00 grep timer&lt;BR /&gt;$ps -ef | grep 13012&lt;BR /&gt;  fifejj 13012 12414  1 11:23:55 pts/ta    0:00 -ksh&lt;BR /&gt;  fifejj 13018 13012  1 11:24:00 pts/ta    0:00 sleep 5&lt;BR /&gt;&lt;BR /&gt;and now invoking a new shell:&lt;BR /&gt;&lt;BR /&gt;$cat timer.sh&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;while(true)&lt;BR /&gt;do&lt;BR /&gt;        sleep 5&lt;BR /&gt;done&lt;BR /&gt;$./timer.sh &amp;amp;&lt;BR /&gt;[1]     13028&lt;BR /&gt;$ps -ef | grep timer&lt;BR /&gt;  fifejj 13032 12414  1 11:24:28 pts/ta    0:00 grep timer&lt;BR /&gt;  fifejj 13028 12414  3 11:24:26 pts/ta    0:00 /bin/ksh ./timer.sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Jul 2006 10:19:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827185#M100472</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-20T10:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: why could not find process?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827186#M100473</link>
      <description>Jonathan, you are right , I can grep sleep 32. I just don't understand why can not grep&lt;BR /&gt;timer.sh  &lt;BR /&gt;   what is the diference betwen  ksh and #!/bin/ksh?&lt;BR /&gt;   if  I use #!/bin/ksh , it seem that I can grep ./timer.sh ?&lt;BR /&gt;    &lt;BR /&gt;    we have servral programs , all exex like&lt;BR /&gt;this :&lt;BR /&gt;    ksh&lt;BR /&gt;    program1 $&lt;BR /&gt;    exit&lt;BR /&gt;    ksh&lt;BR /&gt;    program2 $&lt;BR /&gt;    exit&lt;BR /&gt;    I donot know why they exec like this.&lt;BR /&gt;     can I exec them like this? :&lt;BR /&gt;    #!/bin/ksh&lt;BR /&gt;    program1 $&lt;BR /&gt;     program2 $&lt;BR /&gt;     exit&lt;BR /&gt;thanks a  lot&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Jul 2006 02:52:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827186#M100473</guid>
      <dc:creator>faust2008</dc:creator>
      <dc:date>2006-07-21T02:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: why could not find process?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827187#M100474</link>
      <description>Putting #!/bin/ksh at the beginning of the script will just invoke a new shell. Otherwise, the commands will run in the current shell.&lt;BR /&gt;&lt;BR /&gt;It should be fine to run them in an executable script as &lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;program1 &lt;BR /&gt;program2&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Fri, 21 Jul 2006 07:02:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/why-could-not-find-process/m-p/3827187#M100474</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-21T07:02:49Z</dc:date>
    </item>
  </channel>
</rss>

