13

In a discussion that involves talking about the program named "grep", the activity of applying the program to some data is often referred to as "greping".

I was writing - still informally - about such a discussion, and was unsure how to write that word, and why.

  • The activity of using or applying the tool "grep" is called "greping" when speaking. How to write this word, and why?

    • What about the variants
      • 'greping'
      • 'grepping'
      • 'grep'ing'
      • 'grep-ing'
  • Are there rules to derive such a word, at least partially?



(This question was motivated by
Why is tac file | grep foo' (piping) faster than grep foo < <(tac file)' (process substitution)?,
specifically by the line
"This question was motivated by "Reverse grepping", about greping a huge file from bottom up.".)

  • 4
    The proper spelling is obviously greping. – John Lawler Jul 24 '14 at 14:05
  • 3
    I get really annoyed when people insert strange characters or punctuation to make a verb from a proper noun or make an abbreviation plural like "CD's" (which in my opinion should just be CDs). –  Jul 24 '14 at 14:42
  • 15
    The standard in the Unix community is grepping. Thich is not so unusual- riding a sled becomes sledding taking a step becomes stepping. – Jim Jul 24 '14 at 14:45
  • @GeorgeCapote I was thinking it is technically wrong, but a possible solution to keep the name intact. But now, as grepping is the consensus - what about seeing grep'ing as derived from grepping with the apostrophe representing the second "p"? – Volker Siegel Jul 24 '14 at 14:50
  • 1
    But why use an apostrophe? It's just not the case for it. You're not contracting two words and you're not implying a pause in between the two syllables. –  Jul 24 '14 at 14:51
  • Ok, with what @JanusBahsJacquet is saying in comments below, the feeling that the second "p" is "very wrong" is vanishing - I now accept the choice grepping even emotionally :) – Volker Siegel Jul 24 '14 at 14:59
  • 1
    In case it helps: there is a similar example from physics, where the adjective "gapped" is derived from "gap". Many nonnative speakers misspell it as gaping, which has a different meaning and different pronunciation. – painfulenglish Jul 24 '14 at 15:38
  • @KevinWorkman googled to count matches, concluding that "grepping" is our variant of the word. But... did anybody check what the other 47300 are refering to? ;) – Volker Siegel Jul 24 '14 at 15:47
  • 1
    Aren't the rules just what you learned in 1st grade? Short vowels get double consonant at the end. –  Jul 24 '14 at 16:15
  • 1
    @djechlin Except for the exceptions, like worshiping, labeling, traveling, modeling, etc. (Of course, for those, you'll find the doubled versions in some use, too.) – Joshua Taylor Jul 24 '14 at 17:55
  • How about ssh'ing? – Micah Walter Jul 24 '14 at 17:58
  • @JoshuaTaylor your point? how can a neologism become an exception? wouldn't that just imply the rule is incomplete? how might it magically join the list of exceptions? –  Jul 24 '14 at 18:00
  • 1
    @djechlin My point was more that rules of those sort, especially at the elementary level, often don't carry as much weight in reality as elementary instructors would have us think. But I'd expect that the fact that it is a neologism rather than a word with a long history probably makes it more likely to be an exception to traditional rules and constructions that an arbitrarily selected word might be. There might also be justifications based on the fact that already has an unusual construction (according to Wikipedia,… – Joshua Taylor Jul 24 '14 at 18:06
  • …it's derived from the command "g/re/p", which was short for "(globally search a regular expression and print)". As @JohnPeyton noted above, we might say "ssh'ing" (probably because there's no vowel in "ssh", but also because "ssh" is read as three letters rather than a single word), but if we extrapolate from that the rule that the formation is "[command-name]+'ing", which seems like a good rule, since commands in general might not have pronounceable forms, and thus get "grep'ing". That's a bit more widely applicable, since it allows us ls'ing, cd'ing, ps'ing, etc., and still fits grep'ing. – Joshua Taylor Jul 24 '14 at 18:07
  • @JoshuaTaylor wait what? neologisms are more likely to follow rules and less likely to be exceptions (because they were borrowed from French, spelling changed over time, etc.) –  Jul 24 '14 at 18:09
  • @djechlin So, if we take the +'ing as the rule for how to work with shell command names, "grepping" would be the exception to the rule. I'm happy to conceded that neologisms are more likely to follow the rules of the host language when they're from another natural language, but I'm not so sure that that applies so broadly for technical terms, or even unpronounceable sequences of letters, like we have here. For what it's worth, I would write grepping most of the time, and perhaps grep'ing if I wanted to make sure someone knew that the command was. – Joshua Taylor Jul 24 '14 at 18:12
  • @JohnPeyton SSHing or ssh-ing. – Cees Timmerman Jul 25 '14 at 12:05
  • By the way, I'm currently ncmpcpping some music files :) In this case, the origiinal name ends with the two 'p' already. – Volker Siegel Jul 25 '14 at 12:16
  • @GeorgeCapote > why use an apostrophe? the Dutch use it that way, for example. – törzsmókus Jul 25 '14 at 12:18
  • @GeorgeCapote: There is nearly universal consensus that the plural form of the lowercase «i» is «i's» rather than «is» or «i-s». It is also well accepted that a hyphen should be used when concatenating things which should remain syllabically distinct and, if not punctuated, would form an unrelated word. For example, if a sofa needs new upholstery, one would re-cover it. There are many cases where it would be helpful if an apostrophe could be used for purposes similar to the hyphen, but in cases where the things to either side form part of the same syllable, as with «i's». Such usage... – supercat Jul 25 '14 at 15:25
  • ...wouldn't be proper when forming a present participle of «grep», since the suffix would be a separate syllable, but could be helpful with e.g. «#define'd». Further, I would suggest that in things like signage which are restricted to uppercase letters, all of a single style, the words TVs and CDs would be more easily read if written as TV'S and CD'S than as TVS and CDS. – supercat Jul 25 '14 at 15:32
  • I like to see all the lines in a file when I'm cating it. :) – Scott - Слава Україні Aug 16 '14 at 20:34

7 Answers7

18

The words like that will try to follow the current word-form rules in similar words. (to trap - trapping). The word "grep" is already in some dictionaries and it follows this theory:

verb (greps, grepping, grepped) [with object]:

Search for (a string of characters) using grep.

Vilmar
  • 3,643
13

I was taught in elementary school that if a syllable ends with a vowel, the vowel is normally long, while if it ends with a consonant, the vowel is short. Also that if there is a vowel followed by one consonant in the middle of a word, the consonant is part of the next syllable, while if a vowel is followed by two consonants (that do not work together to make a single sound, like "th"), that the first consonant ends the first syllable and the second consonant begins the second syllable.

Thus: "hatter" - syllables are "hat" and "ter", "a" is short.

"hater" - syllables are "ha" and "ter", "a" is long.

(Yes, there are lots of exceptions, but I was taught this as the general rule.)

As a consequence of this, if a word ends with a single vowel followed by a single consonant, than to keep the vowel short, you must double the consonant when adding -ed or -ing.

Example: "fit" becomes "fitted" and "fitting".

There is no need to double a consonant if the word already ends in two consonants. Like "list" becomes simply "listed" and "listing".

So by these conventional rules, "grep" would become "grepped" and "grepping". If you wrote "greped", we would make the first "e" long, like "greep'd".

Jay
  • 36,223
  • 2
    When in doubt, go back to what you learnt in elementary school. You actually learnt useful stuff there - you just didn't realize it half the time. Big plus-one for this one. – Floris Jul 24 '14 at 20:13
8

This isn't a very technical answer, but googling "grepping" returns 354,000 results. Googling "greping" only returns 47,300 results and suggests that you meant "grepping" instead. It seems that "grepping" is the correct usage.

Kevin Workman
  • 11,324
  • 4
    "Googling" itself is an example of the same phenomenon - deriving a verb which means "to use [the tool from which it is derived]". In this case, "google" is conjugated similarly to "haggle". – trm Jul 25 '14 at 00:15
4

Hyphenated suffixes are usually an idiosyncratic choice that mainly serves stylistic purposes; as far as grammar is concerned, hyphens are normally reserved for words where the suffix is a proper noun or itself a large word (three or more syllables), although there is no consensus and there are exceptions to the rule.[1]

For me there is no need to put quote marks around it either. There is an established body of similarly-derived words in reputable dictionaries by now. That is, names of digital tools used as verbs.

Both Merriam-Webster & Oxford: photoshop, google
Oxford only: skype, even facebook(v.) !!

The only thing left to consider is whether to duplicate the last letter of the root. This has been tackled in other questions[2], although again there is no consensus and in my experience it is often a matter of dialect. It is a lot more common to omit the duplication in American English than in British, despite the obvious challenge that omission creates in pronouncing the word correctly.

In any case, Oxford Dictionary gives the word as grepping.

grep | verb (greps, grepping, grepped)

[with object]

Search for (a string of characters) using grep.


References:

[1] http://www.dailywritingtips.com/close-the-gap-on-prefixes-and-suffixes/

[2] What is the rule for duplicating the last letter when adding "-ed"?

  • Hyphens are also proper in cases where concatenating a prefix or suffix without a hyphen could cause awkwardness or ambiguity, as with re-cover (to cover again). Use of a hyphen in cases where the suffixes are applied to something whose spelling and capitalization are semantically important would seem appropriate unless the audience is sufficiently familiar with the term in question to recognize how the computer would expect it to be written. – supercat Jul 25 '14 at 15:08
  • @supercat I completely agree, but I believe this falls under 'idiosyncratic use.' It is ultimately an open-ended choice for the writer, depending maybe on the audience and the context. – Guybrush Threepwood Jul 25 '14 at 15:46
  • 1
    If use of the tool required spelling its name correctly, and one's audience may be unfamiliar with the correct spelling, using obscure punctuation to avoid changing the spelling of the root "word" may be a least-of-evils choice, especially in the absence of reliable typographical distinctions (IMHO, the space between the root and suffix would make grepping even uglier than grep-ing, but if there were less space the former would be preferred). – supercat Jul 25 '14 at 15:59
  • @supercat Agreed. Very good observation. – Guybrush Threepwood Jul 25 '14 at 16:11
2

Since grep (pronunciation) rhymes with step, I would follow the pattern with stepping and write grepping.

(Writing it as greping makes me want to move short e (/ɡɹɛp/) in the first syllable to a long e, /ɡɹip/, rhyming with weeping. Your mileage may vary.)

Grep comic

Similarly, while awking seems straightforward, I'd favor sedding over seding.

Glorfindel
  • 14,499
rajah9
  • 16,242
  • Yes, I like the variant "grepping" too - what feels wrong is that the second "p" somehow becomes part of the tool name, and changing that makes no sense to me, it's just not a "word" in that sense I think. – Volker Siegel Jul 24 '14 at 13:51
  • 1
    If 'grep' rhymes with 'step', there is no schwa around. – Edwin Ashworth Jul 24 '14 at 13:53
  • 1
    I've never heard anyone pronounce *grep* with a schwa. And I've no reason to disagree with Only words with two or more syllables may have a schwa (except in contexts where words like *a, the, to* happen not to be stressed, but I don't see how that could apply to *grep*). – FumbleFingers Jul 24 '14 at 13:53
  • 1
    When you put it that way, grep always makes me weep, so maybe that would be more appropriate. – Jay Jul 24 '14 at 14:13
  • 2
    @Volker That happens all the time. The present participle of to Google is Googling, not *Googleing. When you start inflecting words that are acronyms or trademarks in origin, you have to accept that you are going to change the spelling of the word at some point, and probably also the logic behind the original acronym. Such is language. – Janus Bahs Jacquet Jul 24 '14 at 14:23
  • @EdwinAshworth, I suppose that depends on how you pronounce "step". – tobyink Jul 24 '14 at 14:31
  • @tobyink Of course. But then no native English speaker that I've ever heard has pronounced step with a schwa. Some Irish dialects have a vowel that is not that far removed from a schwa, but still distinct. – Janus Bahs Jacquet Jul 24 '14 at 14:35
  • @JanusBahsJacquet hmmm... makes sense, I start to emotionally accept the second "p" in grepping now :) – Volker Siegel Jul 24 '14 at 15:02
  • Agreed, Edwin and FumbleFingers; edited to say short e instead of schwa. – rajah9 Jul 24 '14 at 15:17
2

Arguments in other answers for doubling the p are compelling, but also note that Wiktionary (linked to but not quoted in another answer) specifically shows such spelling of grep's present participle, among other forms:

grep (third-person singular simple present greps, present participle grepping, simple past and past participle grepped)

making it clear that at least one dictionary shows the p in grep doubling in its participles.

0

Simply stick "-ing" to a noun to verb it:

  • tool -> tooling
  • shed -> shedding

The reason for the extra "d" in "shedding" is that the "shed" part of "sheding" sounds different.