10 lines
258 B
Bash
10 lines
258 B
Bash
|
#!/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
|