<?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: Cut command usage in in Operating System - Tru64 Unix</title>
    <link>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135266#M4149</link>
    <description>kill -9 $(ps -ef | grep -e "[m]ountd" -e "[a]utomount" | awk '{print $2}')&lt;BR /&gt;&lt;BR /&gt;This works if you have a real shell, ksh.  Add "echo" to the beginning to make sure it's correct.&lt;BR /&gt;&lt;BR /&gt;Note: If you were on HP-UX you would never use grep but the -C option:&lt;BR /&gt;kill -9 $(UNIX95=ENHANCED_PS ps -opid= -C mountd,automount)&lt;BR /&gt;</description>
    <pubDate>Mon, 13 Oct 2008 04:49:46 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2008-10-13T04:49:46Z</dc:date>
    <item>
      <title>Cut command usage in</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135265#M4148</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;$ ps -aef |grep mountd*&lt;BR /&gt;root            546          1  0.0   Oct 09 ??           0:00.03 /usr/sbin/mountd -n -i -n&lt;BR /&gt;root            562          1  0.0   Oct 09 ??           0:00.00 /usr/sbin/automount -m /net -hosts -nosuid&lt;BR /&gt;root          45657      13758  0.0 10:18:27 pts/0        0:00.01 grep mountd*&lt;BR /&gt;&lt;BR /&gt;My main objective is to check for existing daemon (mountd) runs.If it runs i must kill particular pid's.&lt;BR /&gt;&lt;BR /&gt;Say here i must do "kill -9 546" and kill -9 562". Please let me know how to use CUT or AWK command to kill above two pid's..&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance,&lt;BR /&gt;Shammer&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Oct 2008 04:07:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135265#M4148</guid>
      <dc:creator>sammer</dc:creator>
      <dc:date>2008-10-13T04:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command usage in</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135266#M4149</link>
      <description>kill -9 $(ps -ef | grep -e "[m]ountd" -e "[a]utomount" | awk '{print $2}')&lt;BR /&gt;&lt;BR /&gt;This works if you have a real shell, ksh.  Add "echo" to the beginning to make sure it's correct.&lt;BR /&gt;&lt;BR /&gt;Note: If you were on HP-UX you would never use grep but the -C option:&lt;BR /&gt;kill -9 $(UNIX95=ENHANCED_PS ps -opid= -C mountd,automount)&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Oct 2008 04:49:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135266#M4149</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-13T04:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command usage in</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135267#M4150</link>
      <description>&lt;!--!*#--&gt;First, what go you think that&lt;BR /&gt;    grep mountd*&lt;BR /&gt;is doing?  Hint:&lt;BR /&gt;      mkdir new_dir&lt;BR /&gt;      cd new_dir&lt;BR /&gt;and try your command again.&lt;BR /&gt;&lt;BR /&gt;Second, you can eliminate your "grep" command&lt;BR /&gt;from the "ps" listing by using a popular&lt;BR /&gt;trick:&lt;BR /&gt;&lt;BR /&gt;urtx# ps -aef | grep [m]ount&lt;BR /&gt;root            478          1  0.0 00:31:37 ??           0:00.00 /usr/sbin/mountd -i&lt;BR /&gt;root            493          1  0.0 00:31:38 ??           0:00.00 /usr/sbin/automount -m /net -hosts -nosuid&lt;BR /&gt;&lt;BR /&gt;Third, I can remember how to use "sed", but&lt;BR /&gt;I'd need to read up on "awk" or "cut".&lt;BR /&gt;&lt;BR /&gt;urtx# ps -aef | grep [m]ount | sed -e 's/ *[^ ]* *\([^ ]*\) .*/\1/'&lt;BR /&gt;478&lt;BR /&gt;493&lt;BR /&gt;&lt;BR /&gt;If it's not obvious how to do the "kill"&lt;BR /&gt;commands from a list of pid's, then you might&lt;BR /&gt;try something like this:&lt;BR /&gt;&lt;BR /&gt;urtx# ps -aef | grep [m]ount | sed -e 's/ *[^ ]* *\([^ ]*\) .*/\1/' | \&lt;BR /&gt; while read pid ; do echo kill ${pid} ; done&lt;BR /&gt;kill 478&lt;BR /&gt;kill 493&lt;BR /&gt;&lt;BR /&gt;When you're happy, remove "echo".&lt;BR /&gt;&lt;BR /&gt;Now that we've solved _that_ problem, what is&lt;BR /&gt;the _real_ problem which you are trying to&lt;BR /&gt;solve?  And why would killing these processes&lt;BR /&gt;be the best way to solve it?</description>
      <pubDate>Mon, 13 Oct 2008 04:59:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135267#M4150</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-10-13T04:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command usage in</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135268#M4151</link>
      <description>And you had better hope that no one else runs&lt;BR /&gt;anything which your "grep" will falsely&lt;BR /&gt;interpret as one of the processes you're&lt;BR /&gt;trying to kill.  Or else do a much more&lt;BR /&gt;precise search for the processes which you&lt;BR /&gt;_really_ wish to kill (user, parent pid, more&lt;BR /&gt;complete path, and so on), which would be&lt;BR /&gt;harder to do on one line.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Note: If you were on HP-UX [...]&lt;BR /&gt;&lt;BR /&gt;Yeah.  I'd convert all _my_ software to get a&lt;BR /&gt;"ps" with that feature.</description>
      <pubDate>Mon, 13 Oct 2008 05:05:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135268#M4151</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-10-13T05:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cut command usage in</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135269#M4152</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for time on this..&lt;BR /&gt;&lt;BR /&gt;Closing this thread..&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shammer</description>
      <pubDate>Mon, 13 Oct 2008 09:24:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/cut-command-usage-in/m-p/5135269#M4152</guid>
      <dc:creator>sammer</dc:creator>
      <dc:date>2008-10-13T09:24:48Z</dc:date>
    </item>
  </channel>
</rss>

