Chas Owens wrote:
If we are going to pick nits then it should be

grep -c "<employee>" fn


Note that grep -c counts matching *lines*. There is no formal requirement that these elements appear on separate lines.

Here's a slightly more complex Perl one-liner that counts *occurences*

  perl -lne '$n++ for /<employee>/g; END {print $n}' somefile.xml

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to