效果
直接在命令行产生需要的 C 语言源码
#include "stdint.h"
#include "inttypes.h"
Step By Step
-
找出当前目录所有头文件
find . -name '*.h' -o -name '*.hpp'
示例: ./stdint.h ./inttypes.h
-
去掉前面的 './' 字符
find . -name '*.h' -o -name '*.hpp' | sed 's|\./||g'
示例: stdint.h inttypes.h
-
添加 #include " " 字符
find . -name '*.h' -o -name '*.hpp' | sed 's|\./||g' | awk '{print "#include \""$1"\""}'
示例:
#include "stdint.h" #include "inttypes.h"