The revisions let you track differences between multiple versions of a post.
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";
Two lines here are returned meaning that two instances of the word '''"choice"''' have been found, obviously the word being searched for can be anything you may want and additionally the name of the file being searched can also be changed provided the file is a text or script file and the command is run in the same directory that the file is located.
Now lets use the same command but use '''"-i"''' to ignore the case of the characters being searched unfortunately the word '''"choice"''' does not have any uppercase characters within the text supplied so we need to change the word to look for within this script. So we will change searchname to "menu and use the -i option" as this text word appears in both uppercase and lowercase.
This command runs exactly the same as the first the only difference is the choice of word being searched and we have used the '''"-i"''' option to ignore case and flag all instances of word being searched for.
#> grep -i menu menuui.txt
# Script to create simple menus and take action according to that selected
# menu item
echo " Main Menu "
echo -n "Enter your menu choice [1-5]: " | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 |