Revision of Grepping About from Wed, 06/05/2009 - 21:47

The revisions let you track differences between multiple versions of a post.

==What On Earth is Grep== As a tool '''"grep"''' is just one of those commands that once you begin to use you just can't do without, nothing in it name suggests what this command does. [http://en.wikipedia.org/wiki/Grep Wikipedia] documents grep as a command line text search utility originally written for Unix. The name is taken from the first letters in global / regular expression / print, a series of instructions for the ed text editor. The '''"grep"''' command searches a file, files or standard input globally through the lines for matching a given regular expression, and prints them to the program's standard output. So in english using the given format of command searchname filename.txt We can using the above formula search any regular text file for any letter, number or word (now why didn't they say that in the first place). The above is the syntax used is not the actual command used itself to search a file for a given expression being searched for. The actual command used would be something like the following.

#> grep choice menuui.txt

The command syntax followed is command = grep searchname = choice filename.txt = menuui.txt together when this command is run from a terminal or console window, provided you have downloaded the file attachment on this page, this is only an example document the file itself can be any file consisting of text.
#> grep choice menuui.txt echo -n "Enter your menu choice [1-5]: " *) echo "Opps!!! Please select choice 1,2,3,4, or 5";