Ideas, using the GREP command

ChiefIT
ChiefIT used Ask the Experts™
on
Howdy:

I am looking for ideas.

I have a class.

I told the professor I wanted to use the Grep command for my Linux script assignment.

I was under the impression that GREP looked at file names. I did not realize it looks within text files for occurrences.

My original plan to use GREP for a search engine of file names is pretty much shot.

So, I am now finding myself looking for ideas of when you would use the grep command on a regular basis. If you could consolidate the typical uses of Grep, what would they be?

This is what I plan on doing.

I plan on using a loop with nested decision statement to perform some of the typical Grep functions.

number
textstring
filename

Input box, "type the option number of what you want to do"
Do, while not x
 If,  Option 1: find occurances of the text string in the file.
   code
   print
 end
 If,  Option 2: find occurances in multiple files
   code
   print
 end
 If,  Option 3: .....
       Code
       Print
 End
endwhile

See, I am at a loss for ideas on what to do with grep. Can you give me ideas on what you use grep for on a regular basis?

Then, I have to consider the output of the data.  (a list, comma delimited text, ???)

Can you help me lay out a plan for a loop using the grep command??
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
grep is a huge command, you can do lot of things with it. Try to read more for more options. As it is your assignment, I am not commenting more.

Author

Commented:
suggestions on good reading materials? I do see a lot on the web and could use a little help weeding through it.
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Commented:
grep is a 'power tool' for text processor. There are a lot of guidlines for using grep.
e.g: http://linux.about.com/od/commands/l/blcmdl1_grep.htm
But grep is strong when you can associate it with 'regular expression' (grep -E)

Author

Commented:
What languages work well for Linux.

I am getting use to VBS sripting? Where you open up a text document and save it as a .VBS file.

I hear Perl, or Bash scripts, work fine.

I hear VBS scripts don't.

Since I am going to have to create a loop and nested decision statement on a basic command line shell, I am looking for something for beginners with these languages.

Then, I think I will have enough information to start the assignment. So, I will award points.
I'm a Perl fan, but on your grep question; don't neglect the very powerful piping feature of shell scripting.  Try experimenting with piping some things through grep to see what comes out.  I think that might lead you to finding your answer.

Author

Commented:
Thanks guys,

You have been helpful.

I didn't know where to start on this project. Now, I have some ideas.

I really appreciate it.

Author

Commented:
Thanks for starting me off on this.

I appreciate it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial