[Novalug] bash commands
Nino Pereira
pereira at speakeasy.net
Sat Jan 19 11:20:18 EST 2008
Michael,
thank you for your extensive comments: they put things together
for me. I wish people on the the mailing list would summarize
the complicated answer to simple questions like mine more often.
Your answer deserves a comparatively effort on my part, viz.,
the reasons for my question. You will see that my needs are simple.
I'm trying to modify a fortran program, of 1970s vintage,
that I've worked with on occasion since the early 1980s.
It has been rewritten by others many times, so that it is now
substantially more complicated than it was when I first looked
at the code. For example, it now has its subroutines in separate
files (as *.F) in one directory, its common blocks (as *.h) in another.
So, when I must make sure that a variable in one subroutine is
communicated to another, I have to know where it is initialized,
and which common block it sits in.
I might remember much of this if I had been working with the code
continuously, but I haven't: I'm just getting back to it.
That's why I needed a good way to find ALL occurrences of strings,
in all the relevant files.
For my purpose the simplest command suggested,
>
> grep 'pattern' *.f
>
does the trick. I have 27 files in one directory, 67 in the
other (found by ls -l 'directory' | wc), so I don't hit any limits.
Thanks to all.
Nino
More information about the Novalug
mailing list