Results 1 to 4 of 4

Thread: Basic Arithmetic?

  1. #1
    Join Date
    Oct 2006
    Beans
    53

    Basic Arithmetic?

    I'm unable to come up with a script that works at all for this....

    What I want to do is have a simple grep go through a file (000000*.log) each day, and search for the word "new", and add up the sum of all of those "new" words.

    I tried to do it in bash, but have yet to come up with anything successfully. : (

  2. #2
    Join Date
    Apr 2007
    Beans
    88

    Re: Basic Arithmetic?

    Can't you just use 'wc -l' or am I misunderstanding the problem?
    Code:
    grep "new" 000000*.log | wc -l

  3. #3
    Join Date
    Oct 2006
    Beans
    53

    Re: Basic Arithmetic?

    That is exactly what I needed thank you very much. : )

  4. #4
    Join Date
    Feb 2007
    Beans
    2,729

    Re: Basic Arithmetic?

    Code:
    grep -c new 000000*.log
    MrC

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •