[Lilug] alias
Jörg Kewisch
jorg at mellifera.buzz
Wed Jan 27 08:31:46 PST 2021
I am using tcsh and debugging a fortran77 program. Long story: in fortran77 all local variables were static (i.e. have a fixed memory location. If you entered a function all variables were as you left them in the previous call) and were initialized with zero. IN fotran90 (gfortran) all local variables are on the stack (i.e when you enter a function the values are what ever a different function left there). So I have to search all code and find all occurrences of a variable name.\, like
grep -in varnam *.f90
so to save typing I made an alias:
alias ff 'grep -in \!* *.f90'
and I can now use that as
ff varnam
and get what I want. But the old fortran programmers loved to use 1 letter variable names and
ff a
will give me thousands of lines. grep is smarter than that:
grep -in "\<a\>" *.f90
will give me only the lines that contain the variable "a" (and not those with "read"). So I made a new alias
alias fff 'grep -in \'\<\!*\>\' *.f90'
and get the error:
Unmatched '''.
What did I do wrong?
--
Jörg Kewisch
jorg at mellifera.buzz
More information about the Lilug
mailing list