A basic reimplementation of grep using C.
I have little experience with the C language and want to learn more of it. No AI agents will be used in this project.
I won't be aiming for full feature parity with grep. Currently supported optional arguments:
-iCase insensitive search-nPrint line number with output lines-vInvert matches (select non-matching lines)-mstop after N matching lines
You should first compile the main.c file into a binary:
gcc -o ara main.c -lmThis will compile ara into a binary named ara.
Now, you can use ara just like you would use grep:
./ara "error" server.logAn example:
./ara -in "millet" istiklal-marsi.txtOutput:
3: O benim milletimin yıldızıdır, parlayacak;
4: O benimdir, o benim milletimindir ancak.
8: Hakkıdır, Hakk’a tapan, milletimin istiklâl.
41: Hakkıdır, Hakk’a tapan milletimin istiklâl!