Skip to contentSkip to conversation

(unknown)

DISCUSSION n mishra 2 participants 2 messages Feb 27, 2003 – Feb 28, 2003

lore
Share & tools
lore

n mishra

author
#0 lore raw

Hi all,
I am trying to write a program in c to be able to search a file for any pattern which will be given by the user at runtime.Basically a search tool. Could someone suggest a good way of doing this.I've heard of lex and yacc and also awk.Which one is better or is there any other option. Or is there any way i can use something like grep through a 'c' program.
Thanks
mishra

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw

Re: Search tool

Quoted 6 lines

I am trying to write a program in c to be able to search a file for any pattern which will be given by the user at runtime.Basically a search tool.
Could someone suggest a good way of doing this.I've heard of lex and yacc and also awk.Which one is better or is there any other option.

Indeed.
Some days ago there was a discussion in the ML "File name with spaces" - go through a filesystem and make something. You can use use this as input.

Quoted 2 lines

Or is there any way i can use something like grep through a 'c' program.

Check the manpages of opendir, readdir... and regex

Good look,
Robin
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs