• 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: Spellcheck a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spellcheck a list


  • Subject: Re: Spellcheck a list
  • From: Graff <email@hidden>
  • Date: Tue, 05 Oct 2004 08:28:02 -0400

On Oct 5, 2004, at 5:08 AM, Dennis W. Manasco wrote:

At 12:07 pm -0400 10/4/04, Graff wrote:

I did use a regular expression. I added the start-of-line marker "^" and the end-of-line marker "$" to the string before I quoted it. I did this so that I would get only unique matches rather than any line that contained the string. For example:

using:
    grep '^youth$' /usr/share/dict/words
gives me:
    youth

using:
    fgrep 'youth' /usr/share/dict/words
gives me:
    overyouthful
    preyouthful
    ...
    ...

using: fgrep -iw 'youth' /usr/share/dict/words

gives only:
youth

(OMM)
(See 'man fgrep' in Terminal.)

Yeah, I just noticed that this works in the same way: fgrep -x 'youth' /usr/share/dict/words

The -x option makes sure that the string is the only thing on the line, basically the same thing as adding the beginning-of-line and end-of-line markers. It's a bit better than -w because -w looks for individual words. If the file has two words on a line and one matches then you'll get the whole line. The file '/usr/share/dict/web2a' has multiple words per line so you might not get exact matches if you used -w on it.

One of the headaches of command-line tools is noticing and understanding all of the options available to you! Some of the tools are so powerful if you can understand all of the things they do.

- Ken

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Spellcheck a list
      • From: Jean-Baptiste LE STANG <email@hidden>
References: 
 >Re: Spellcheck a list (From: Jan Steinman <email@hidden>)
 >Re: Spellcheck a list (From: Graff <email@hidden>)
 >Re: Spellcheck a list (From: "Dennis W. Manasco" <email@hidden>)

  • Prev by Date: No way to tell if an application is running without launching it?
  • Next by Date: Re: No way to tell if an application is running without launching it?
  • Previous by thread: Re: Spellcheck a list
  • Next by thread: Re: Spellcheck a list
  • Index(es):
    • Date
    • Thread