Re: awk command help

From: Jeremiah DeWitt Weiner (jdw_at_panix.com)
Date: 10/27/04


Date: Wed, 27 Oct 2004 20:23:28 +0000 (UTC)

Vish grover <vishal_stud@yahoo.com> wrote:
> The only problem I have is that only my function with swapped params
> shows up. How can I get the contents of the whole .c file in my output
> with the appropriate changes.

        Use an if-then construct so your script just prints out the record
unmodified if the relevant word isn't found. Something like this:

{
 if (/my-function/) { print "My stuff goes here";}
 else { print; }
}

JDW