• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Search a file question - Mac OS 9
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Search a file question - Mac OS 9


  • Subject: Re: Search a file question - Mac OS 9
  • From: bill fancher <email@hidden>
  • Date: Tue, 17 Sep 2002 11:21:25 -0700

On Tuesday, September 17, 2002, at 10:24 AM, Charles Heizer wrote:

Hello,
I'm having some trouble getting a script to read a log file to work properly.

I'm trying to find any line that that contains "RC [someerror]" for example. Then write that line with it's line number out to a new text file. The thing is I don't want it to grab the lines that contain "RC [0]" because a return code of zero means there were no problems.

Assuming "someerror" is always a number:

do shell script "grep -n 'RC \\[[1-9][0-9]*\\]' /path/to/input > /path/to/output"

You can pipe that through something else if you need to tweak the output format. Let us know...

HTH,
--
bill



Thanks,

- Charles
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Search a file question - Mac OS 9
      • From: bill fancher <email@hidden>
References: 
 >Search a file question - Mac OS 9 (From: Charles Heizer <email@hidden>)

  • Prev by Date: beep broken in 10.2?
  • Next by Date: Re: Droplet Problem
  • Previous by thread: Search a file question - Mac OS 9
  • Next by thread: Re: Search a file question - Mac OS 9
  • Index(es):
    • Date
    • Thread