#define problem

Pyung-Chul Kim pckim at unisql.UUCP
Fri Jun 21 01:22:29 AEST 1991


In article <1991Jun20.051827.23428 at ux1.cso.uiuc.edu> J-Beauchamp at uiuc.edu writes:
>I have many occurences of 'printf(' which I would like to replace with
>'fprintf(stderr,' in my C program.  Is there a way to do this #define?
>
>#define printf( fprintf(sterr,
>

Why don't you use a shell program like following:

% chngprintf * */* */*/* .... (specify all files you want to change)

% cat chngprintf
#!/bin/csh -f
 
foreach f ($argv)
	echo "Editing file: $f"
	ed $f << END > /dev/null
1,\$s/printf(/fprintf(stderr,/g
w
q
END
end

I hope it helps

-- 
Pyung-Chul Kim

UniSQL, Inc.
9390 Research Blvd., Kaleido II, Suite 220, Austin, TX 78759
Internet: execu!sequoia!unisql!pckim at cs.utexas.edu
UUCP: {uunet, cs.utexas.edu!execu}!sequoia!unisql!pckim
TEL: (512)343-7297 Ext. 332
FAX: (512)343-7383



More information about the Comp.lang.c mailing list