• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

GREP, does it have meaning?

fs5

Lifer
What does grep stand for? Why is it called grep and not search?

While we're at it why is foo used so often?
 
foo:
/foo/ 1. interj. Term of disgust. 2. [very common] Used very generally as a sample name for absolutely anything, esp. programs and files (esp. scratch files). 3. First on the standard list of metasyntactic variables used in syntax examples. See also bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud. When `foo' is used in connection with `bar' it has generally traced to the WWII-era Army slang acronym FUBAR (`fvcked Up Beyond All Repair' or `fvcked Up Beyond All Recognition'), later modified to foobar. Early versions of the Jargon File interpreted this change as a post-war bowdlerization, but it it now seems more likely that FUBAR was itself a derivative of `foo' perhaps influenced by German `furchtbar' (terrible) - `foobar' may actually have been the _original_ form. For, it seems, the word `foo' itself had an immediate prewar history in comic strips and cartoons. The earliest documented uses were in the "Smokey Stover" comic strip published from about 1930 to about 1952. Bill Holman, the author of the strip, filled it with odd jokes and personal contrivances, including other nonsense phrases such as "Notary Sojac" and "1506 nix nix". The word "foo" frequently appeared on license plates of cars, in nonsense sayings in the background of some frames (such as "He who foos last foos best" or "Many smoke but foo men chew"), and Holman had Smokey say "Where there's foo, there's fire". According to the Warner Brothers Cartoon Companion (http://www.spumco.com/magazine/eowbcc/) Holman claimed to have found the word "foo" on the bottom of a Chinese figurine. This is plausible; Chinese statuettes often have apotropaic inscriptions, and this one was almost certainly the Mandarin Chinese word `fu' (sometimes transliterated `foo'), which can mean "happiness" or "prosperity" when spoken with the rising tone (the lion-dog guardians flanking the steps of many Chinese restaurants are properly called "fu dogs"). English speakers' reception of Holman's `foo' nonsense word was undoubtedly influenced by Yiddish `feh' and English `fooey' and `fool'. Holman's strip featured a firetruck called the Foomobile that rode on two wheels. The comic strip was tremendously popular in the late 1930s, and legend has it that a manufacturer in Indiana even produced an operable version of Holman's Foomobile. According to the Encyclopedia of American Comics, `Foo' fever swept the U.S., finding its way into popular songs and generating over 500 `Foo Clubs.' The fad left `foo' references embedded in popular culture (including a couple of appearances in Warner Brothers cartoons of 1938-39; notably in Robert Clampett's "Daffy Doc" of 1938, in which a very early version of Daffy Duck holds up a sign saying "SILENCE IS FOO!") When the fad faded, the origin of "foo" was forgotten. One place "foo" is known to have remained live is in the U.S. military during the WWII years. In 1944-45, the term `foo fighters' was in use by radar operators for the kind of mysterious or spurious trace that would later be called a UFO (the older term resurfaced in popular American usage in 1995 via the name of one of the better grunge-rock bands). Because informants connected the term directly to the Smokey Stover strip, the folk etymology that connects it to French "feu" (fire) can be gently dismissed. The U.S. and British militaries frequently swapped slang terms during the war (see kluge and kludge for another important example) Period sources reported that `FOO' became a semi-legendary subject of WWII British-army graffiti more or less equivalent to the American Kilroy. Where British troops went, the graffito "FOO was here" or something similar showed up. Several slang dictionaries aver that FOO probably came from Forward Observation Officer, but this (like the contemporaneous "FUBAR") was probably a backronym . Forty years later, Paul Dickson's excellent book "Words" (Dell, 1982, ISBN 0-440-52260-7) traced "Foo" to an unspecified British naval magazine in 1946, quoting as follows: "Mr. Foo is a mysterious Second World War product, gifted with bitter omniscience and sarcasm." Earlier versions of this entry suggested the possibility that hacker usage actually sprang from "FOO, Lampoons and Parody", the title of a comic book first issued in September 1958, a joint project of Charles and Robert Crumb. Though Robert Crumb (then in his mid-teens) later became one of the most important and influential artists in underground comics, this venture was hardly a success; indeed, the brothers later burned most of the existing copies in disgust. The title FOO was featured in large letters on the front cover. However, very few copies of this comic actually circulated, and students of Crumb's `oeuvre' have established that this title was a reference to the earlier Smokey Stover comics. The Crumbs may also have been influenced by a short-lived Canadian parody magazine named `Foo' published in 1951-52. An old-time member reports that in the 1959 "Dictionary of the TMRC Language", compiled at TMRC, there was an entry that went something like this: FOO: The first syllable of the sacred chant phrase "FOO MANE PADME HUM." Our first obligation is to keep the foo counters turning.(For more about the legendary foo counters, see TMRC.) This definition used Bill Holman's nonsense word, then only two decades old and demonstrably still live in popular culture and slang, to a {ha ha only serious} analogy with esoteric Tibetan Buddhism. Today's hackers would find it difficult to resist elaborating a joke like that, and it is not likely 1959's were any less susceptible. Almost the entire staff of what later became the MIT AI Lab was involved with TMRC, and the word spread from there.
 
grep > *
grep is how you search for text strings and regular expressions in text files on a unix system.

On old IBM PC personal computers, the BIOS code resided in memory. The address was F000 because memory required a point counter. At least that's what I've been told by smart people.
 
grep Command

Purpose

Searches a file for a pattern.

Syntax

grep [ -E | -F ] [ -i ] [ -h ] [ -s ] [ -v ] [ -w ] [ -x ] [ -y ] [ [ [ -b ] [
-n ] ] | [ -c | -l |-q ] ] [ -p [ Separator ] ] { [ -e PatternList ... ] [ -f
PatternFile ... ] | PatternList ... } [ File ... ]

Description

The grep command searches for the pattern specified by the Pattern parameter an
writes each matching line to standard output. The patterns are limited regular
expressions in the style of the ed or egrep command. The grep command uses a
compact non-deterministic algorithm.

The grep command displays the name of the file containing the matched line if
you specify more than one name in the File parameter. Characters with special
meaning to the shell ($, *, [, |, ^, (, ), \ ) must be in quotation marks when
they appear in the Pattern parameter. When the Pattern parameter is not a simpl
string, you usually must enclose the entire pattern in single quotation marks.
In an expression such as [a-z], the - (minus sign) cml specifies a range,
according to the current collating sequence. A collating sequence may define
equivalence classes for use in character ranges.

Notes:

1. Lines are limited to 2048 bytes.
2. Paragraphs (under the -p flag) are currently limited to a length of
5000 characters.
3. Do not run the grep command on a special file because it produces
unpredictable results.
4. Input lines should not contain the NULL character.
5. Input files should end with the new-line character.
6. The new-line character will not be matched by the regular expressions.
7. Although some flags can be specified simultaneously, some flags
override others. For example, the -l option takes precedence over all
other flags. And if you specify both the -E and -F flags, the last one
specified takes priority.

Flags

-b Precedes each line by the block number on which it was found. Use this flag
to help find disk block numbers by context. The -b flag cannot be used with
input from stdin or pipes.

-c Displays only a count of matching lines.

-E Treats each pattern specified as an extended regular expression (ERE). A NUL
value for the ERE matches every line.

Note: The grep command with the -E flag is the same as the egrep command,
except that error and usage messages are different and the -s flag function
differently.

-e PatternList Specifies one or more search patterns. This works like a simple
pattern but is useful when the pattern begins with a - (minus). Patterns should
be separated by a new-line character. A NULL pattern can be specified by two
adjacent new-line characters or a quotation mark followed by a new-line
character ("\n). Each pattern is treated like a basic regular expression (BRE)
unless the -E or -F flag is also specified.

-F Treats each specified pattern as a string instead of a regular expression. A
NULL string matches every line.

Note: The grep command with the -F flag is the same as the fgrep command,
except that error and usage messages are different and the -s flag function
differently.

-f PatternFile Specifies a file containing search patterns. Each pattern should
be separated by a new-line character, and an empty line is considered a NULL
pattern. Each pattern is treated like a basic regular expression (BRE), unless
the -E or -F flag is also specified.

-h Suppresses file names when multiple files are specified.

-i Ignores the case (uppercase or lowercase) of letters when making comparisons

-l Lists just the names of files (once) which contain matching lines. Each file
name is separated by a new-line character. If standard input is searched, a pat
name of (StandardInput) is returned. The -l flag with any combination of the -c
and -n flags behaves like the -l flag only.

-n Precedes each line with the relative line number in the file. Each file
starts at line 1, and the line counter is reset for each file processed.

-p[Separator] Displays the entire paragraph containing matched lines. Paragraph
are delimited by paragraph separators, as specified by the Separator parameter,
which are patterns in the same form as the search pattern. Lines containing the
paragraph separators are used only as separators; they are never included in th
output. The default paragraph separator is a blank line.

-q Suppresses all writing to standard output, regardless of matching lines.
Exits with a zero status if an input line is selected. The -q flag with any
combination of the -c, -l and -n flags behaves like the -q flag only.

-s Suppresses error messages ordinarily written for nonexistent or unreadable
files. Other error messages are not suppressed.

-v Displays all lines not matching the specified pattern.

-w Does a word search.

-x Displays lines that match the specified pattern exactly with no additional
characters.

-y Ignores the case of letters when making comparisons.

PatternList Specifies one or more patterns to be used during the search. The
patterns are treated as if they were specified using the -e flag.

File Specifies a name of a file to be searched for patterns. If no File variabl
is given, the standard input is used.

Exit Status

This command returns the following exit values:

0 A match was found.

1 No match was found.

>1 A syntax error was found or a file was inaccessible (even if matches were
found).
 
You guys suck at answering questions. He wants to know what the name "grep" means, not what it does or how to use it.

It's like he's asking "What the hell does Camaro mean?" and you guys are answering with "It has a 5.7 liter 305 horsepower V8 and was first produced in 1967"
 
we know what grep DOES, but where did the name "grep" come from? 😛

EDIT - yeah, what notfred said 😛
 
Originally posted by: yoda291
grep > *
grep is how you search for text strings and regular expressions in text files on a unix system.

On old IBM PC personal computers, the BIOS code resided in memory. The address was F000 because memory required a point counter. At least that's what I've been told by smart people.

yes yes, I know what grep does, but why is it called grep!

notfred: cliffs? 😀 I read it, but is that the REAL reason?
I read some more of it, now I'm beyond confused 🙂
 
Oh, and my guess is that GREP stands for "General Regular Expression Parser" or something like that, which fits very nicely, but I just made it up.

Or maybe GNU Regular Expression Parser?
 
Originally posted by: notfred
Oh, and my guess is that GREP stands for "General Regular Expression Parser" or something like that, which fits very nicely, but I just made it up.

Or GNU Regular Expression Parser...

The "General Regular Expression Parser" was my understanding too.

 
Originally posted by: notfred
Oh, and my guess is that GREP stands for "General Regular Expression Parser" or something like that, which fits very nicely, but I just made it up.

Or maybe GNU Regular Expression Parser?

yea that was gonna be my guess too... or processor
 
Originally posted by: Bootprint
Originally posted by: notfred
Oh, and my guess is that GREP stands for "General Regular Expression Parser" or something like that, which fits very nicely, but I just made it up.

Or GNU Regular Expression Parser...

The "General Regular Expression Parser" was my understanding too.

or Global...
 
Originally posted by: notfred
Oh, and my guess is that GREP stands for "General Regular Expression Parser" or something like that, which fits very nicely, but I just made it up.

Or maybe GNU Regular Expression Parser?

grep preceeded GNU. According to the HISTORY section of the manpage on my system, grep appeared in Version 6 AT&T UNIX.
 
Originally posted by: fivespeed5
Originally posted by: yoda291
grep > *
grep is how you search for text strings and regular expressions in text files on a unix system.

On old IBM PC personal computers, the BIOS code resided in memory. The address was F000 because memory required a point counter. At least that's what I've been told by smart people.

yes yes, I know what grep does, but why is it called grep!

notfred: cliffs? 😀 I read it, but is that the REAL reason?
I read some more of it, now I'm beyond confused 🙂


Yuo teh suck @ Google
 
Originally posted by: Nitemare
Originally posted by: fivespeed5
Originally posted by: yoda291
grep > *
grep is how you search for text strings and regular expressions in text files on a unix system.

On old IBM PC personal computers, the BIOS code resided in memory. The address was F000 because memory required a point counter. At least that's what I've been told by smart people.

yes yes, I know what grep does, but why is it called grep!

notfred: cliffs? 😀 I read it, but is that the REAL reason?
I read some more of it, now I'm beyond confused 🙂


Yuo teh suck @ Google

🙂 well that was easy...

... end of thread ...
 
Back
Top