Writing C program to implement UNIX commands like grep.

Writing C program to implement UNIX commands like grep.

Code:


Output:

elcot@elcot:~$ gcc -o g1 grepc.c
elcot@elcot:~$ ./g1 hai test1
hai how are you

Hints:

elcot@elcot:~$ gcc -o g1 grepc.c  ->Compile
grepc.c ->program name
g1 -> create object

elcot@elcot:~$ ./g1 hai test1  -> Run
g1 -> object
hai -> string
test1 -> file name

This is grep command implementation.
grep syntax:
grep <String> <file name>

grep command is used to search a  particular word in file.etc.

12 comments:

Powered by Blogger.