For example, if I have the C files:
game.c
int main(){
//code
}
hello.c
int something(){
//code
}
How would I get the output to be:
/directory/path/game.c
int main()
/directory/path/hello.c
int something()
I've already written a for loop to iterate through the files ending in .c in a directory, but am unsure on how to output the function names?
So Im trying to execute a shell script which will read the C files and then output its function names.
for file in $(find $1 -type f -name '*.c')
do
echo $file
grep -r "what to search for??"
done