Hello,
I need to program grep (like the one UNIX has but more simple)
For example if the programs name(the grep I will write) is p3 then if
I write in shell
p3 story.txt word
The output should be all lines where the word "word" appears.
The problem is that I am suppose to use this command in shell as well
ls | p3 word
The output should be the lines that the word "word" appears in with in
all files of the directory.
My question is what can I do with that? I mean ls is not my command
its a shell command. What kind of paramters do I get in order to
understand that I need all the files and how do I find all the files
in the directory. The first case isn't that clear either.
Any tutorial or something (like a *.h) files that can help?
Thanks