William L. Maltby wrote:
>
> On Wed, 2007-10-10 at 16:10 -0400, Ross S. W. Walker wrote:
> > Stephen Harris wrote:
> > >
> > > On Wed, Oct 10, 2007 at 04:32:30PM -0300, mups.cp wrote:
> > > >
>
> > Well he never stated a non-standard field separator, but if
> that is the case, with awk:
> >
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 10/11/07, William L. Maltby wrote:
> Personally, in many years of use, I feel I still do not need to learn
> Perl (although I did get a book and dabble with it some) for 99.9% of
> things that *I* do.
>
> Awk does the job for me.
>
If it's any
On Wed, 2007-10-10 at 16:10 -0400, Ross S. W. Walker wrote:
> Stephen Harris wrote:
> >
> > On Wed, Oct 10, 2007 at 04:32:30PM -0300, mups.cp wrote:
> > >
> Well he never stated a non-standard field separator, but if that is the case,
> with awk:
>
> echo "jerry,jerry-jerry jerry" | awk 'BEGIN
On 10/10/07, Ross S. W. Walker <[EMAIL PROTECTED]> wrote:
> True!
>
> Regular expressions sure are fun :-)
>
> I think we've shown enough variations here to give the OP the
> idea that there are a lot of ways to skin this cat.
But we have to think him for the mental stimulation. Its nice to see
t
Stephen Harris wrote:
>
> On Wed, Oct 10, 2007 at 04:10:05PM -0400, Ross S. W. Walker wrote:
> > Stephen Harris wrote:
> > >
> > > On Wed, Oct 10, 2007 at 04:32:30PM -0300, mups.cp wrote:
> > > > A simple one
> > > > # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> > > > 2
> > >
> > > But wh
James Olin Oden wrote:
>
> On 10/10/07, Ross S. W. Walker <[EMAIL PROTECTED]> wrote:
> > mups.cp wrote:
> > >
> > > A simple one
> > > # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> > > 2
> > >
> > > The perl seems more general.
> >
> >
> > To add yet another variation:
> >
> > echo "jerry j
On Wed, Oct 10, 2007 at 04:10:05PM -0400, Ross S. W. Walker wrote:
> Stephen Harris wrote:
> >
> > On Wed, Oct 10, 2007 at 04:32:30PM -0300, mups.cp wrote:
> > > A simple one
> > > # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> > > 2
> >
> > But what about jerry.jerry or jerry/jerry or jerr
Ross S. W. Walker wrote:
>
> mups.cp wrote:
> >
> > A simple one
> > # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> > 2
> >
> > The perl seems more general.
>
>
> To add yet another variation:
>
> echo "jerry jerry" | awk 'BEGIN {RS=FS} {/jerry/ jerry++} END
> {print jerry}'
That shou
On 10/10/07, Ross S. W. Walker <[EMAIL PROTECTED]> wrote:
> mups.cp wrote:
> >
> > A simple one
> > # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> > 2
> >
> > The perl seems more general.
>
>
> To add yet another variation:
>
> echo "jerry jerry" | awk 'BEGIN {RS=FS} {/jerry/ jerry++} END {pr
Stephen Harris wrote:
>
> On Wed, Oct 10, 2007 at 04:32:30PM -0300, mups.cp wrote:
> > A simple one
> > # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> > 2
>
> But what about jerry.jerry or jerry/jerry or jerry,jerry or
Well he never stated a non-standard field separator, but if that is
mups.cp wrote:
>
> A simple one
> # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> 2
>
> The perl seems more general.
To add yet another variation:
echo "jerry jerry" | awk 'BEGIN {RS=FS} {/jerry/ jerry++} END {print jerry}'
-Ross
> On 10/10/07, Andy Harrison <[EMAIL PROTECTED]> wrote:
>
On Wed, Oct 10, 2007 at 04:32:30PM -0300, mups.cp wrote:
> A simple one
> # echo "jerry jerry" | tr " " "\n" | grep -c jerry
> 2
But what about jerry.jerry or jerry/jerry or jerry,jerry or
(and please don't top post!)
--
rgds
Stephen
___
CentOS m
A simple one
# echo "jerry jerry" | tr " " "\n" | grep -c jerry
2
The perl seems more general.
On 10/10/07, Andy Harrison <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>
> On 10/10/07, Jerry Geis wrote:
> > Is there a command line option on grep that says
> > c
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 10/10/07, Jerry Geis wrote:
> Is there a command line option on grep that says
> count ALL occurances on a line not just the first one???
>
> echo "jerry jerry" | grep -c jerry
>
Grep can just count the number of lines with occurrences not the
n
Is there a command line option on grep that says
count ALL occurances on a line not just the first one???
echo "jerry jerry" | grep -c jerry
only returns 1 and not 2.
Looking at the man page I did not see anything like that.
Thanks,
Jerry
___
CentOS
15 matches
Mail list logo