sysy/scripts/inc.sh

10 lines
258 B
Bash
Raw Normal View History

2024-04-14 22:20:29 +08:00
#!/bin/bash
# 遍历当前目录下的所有.c文件
for file in sy/*.c; do
# 检查文件是否存在
if [ -f "$file" ]; then
# 向每个文件的开头添加#include "sylib.h"
sed -i '1s/^/#include "sylib.h"\n/' "$file"
fi
done