I am writing a script which parses /* to find out the commented portion of the code.
I am using grep "/\*" file.c
Following is the code snippet
for i in `grep "/\*" file.c`; do
but this is not giving the lines greped from file.c.
However if I run this command from the shell i.e.
grep "/\*" file.c I get the correct answer, I think the problem is due to ` .
Can some body help me on this
Ok, unfortunately, the only thing left to do, that I can think of, is to do the script this way:
for i in `grep "/\\*" file`; do
And start the entire script without file name generation. That means, however, that file name expansion/generation does not work at all in the script, which may be wholly unenjoyable, but at least this part works.