For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2006 > Printing the name of the C function that contains a pattern









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Printing the name of the C function that contains a pattern
Karthick S.

2006-09-24, 6:57 pm

Hi,

I am writing a shell script that will print the name of the C function
that contains a specified pattern. I found that grep prints the
"context" of a pattern, but could not find any method to exactly print
the name of the C function which contains the specified pattern.

For example:
#include <stdio.h>

int fun1()
{
// Some lines here
printf("Hello World")
// Some lines here
}

How do I print "fun1" using awk/sed/bash/perl?

Please help me.

Thanks and regards,
Karthick S.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com