Structure Query Language, C programming, Java, Servlet, Jsp, Unix
Home
Special
C / C++
GTU [PL/SQL]
IVAN BAYROSS [SQL]
JAVA
UNIX
WTAD
FON
Contact Us
CPP
Android
SEO
Friday, 30 March 2012
Write a shell script to add the statement #include
at the beginning of every C source file in current directory containing printf and fprintf
grep -lw -e "printf" -w -e "fprintf" *.c > $$
for filename in `cat $$`
do
sed '1i\
#include<stdio.h>\
#include<conio.h>
' $filename > $$$
`cat $$$>$filename`
rm $$$
done
rm $$
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment