<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 5, 2012, at 5:42 PM, Eitan Adler wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Thu, Jan 5, 2012 at 5:37 PM, Matthew Story <<a href="mailto:matt@tablethotels.com">matt@tablethotels.com</a>> wrote:<br><blockquote type="cite">Decided to share a slick hack to cut the grep program out of the ps resulsts that Jan sent my way as a bug report ... this goes against what I said in the talk about there not being a way to do this with only 1 invocation of grep ... and is slick as hell (total nifty(1) fodder):<br></blockquote><br><blockquote type="cite">ps aux | grep "gre[p]"<br></blockquote><br>or just use pgrep?<br><br></div></blockquote></div><br><div><br></div><div>Or just not use grep at all. </div><div><br></div><div>I use this one to capture PIDs of interest. Like to ensure that my rsync job to a specific host has only one job at a time. Substitute what ever entity you are searching for between the $0's and let awk work it's magick.</div><div><br></div><div>ps ax | awk '$0~/rsync --stats -avzr /&&$0!~/awk/{print $1}'`</div><br><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Helvetica Neue'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div>Regards,</div><div>Mikel King</div><div>BSD News Network</div><div><a href="http://bsdnews.net">http://bsdnews.net</a></div><div>skype: mikel.king</div><div><a href="http://twitter.com/mikelking">http://twitter.com/mikelking</a></div></div><div><br></div></span></div></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>