New sed or awk question,thanks for last answer
rkc
rkc at XN.LL.MIT.EDU
Fri May 26 22:51:10 AEST 1989
Thanks to those who answered my last sed question concerning stripping blank
lines and lines starting with # from a file. The solution was:
sed -e '/^#/D' -e '/^[<space><tab>]*$/D' filename or
sed -e '/^#/D' -e '/^[<space><tab>]*$$/D' filename in a makefiley
My new question is much tougher, (I'm not certain it can be done with sed, or
grep, but that it may require awk.) I want to strip out all of the subroutine
definitions of a file up to and including the { character. In other words,
give a file with
/*
Lots of comments
*/
float *
function_name(arg1,arg2)
argtype arg1;
argtype arg2;
{
<the fn>
}
I want to get back:
float *
function_name(arg1,arg2)
argtype arg1;
argtype arg2;
{
Does anyone have code that does this, or can anyone suggest a script to do
this? Thanks for your help.
-Rob
Please e-mail responses, as I do not follow this group. I will post if enough
interest.
More information about the Comp.unix.questions
mailing list