Check this out.

# ps -aux | grep tail root 19775 0.1 0.2 968 656 pts/3 S 17:07:27 0:00 grep tail root 3030 0.0 0.2 1008 696 pts/4 S 10:23:21 0:00 tail -f /va +r/adm/dd # ps -aux | grep 't\ail' root 3030 0.0 0.2 1008 696 pts/4 S 10:23:21 0:00 tail -f /va +r/adm/dd

Update: I like petral's way.

First time I saw this I thought it was a typo. ;) Pick a character that doesn't have special meaning to grep when '\' is used before it.

or # ps -aux | grep '(httpd|named)' | grep -v grep or #!/usr/bin/perl @ps = qx(ps aux); @httpd = grep {/httpd/} @ps; @named = grep {/named/} @ps; print "httpd's:\n\t", join("\n\t", @httpd), "\nnamed's:\n\t", join("\n\t", @named), "\n";

In reply to Re: Searching strings within an array for a particular word. by zengargoyle
in thread Searching strings within an array for a particular word. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.