25 lines
686 B
Bash
25 lines
686 B
Bash
#!/bin/bash
|
|
|
|
# 定义文件夹路径数组
|
|
folder_path_vec=(
|
|
final_performance_c/sy
|
|
performace_c/sy
|
|
hidden_functional_c/sy
|
|
functional_c/sy
|
|
final_performance_c/sy
|
|
)
|
|
|
|
# 迭代文件夹路径数组
|
|
for folder_path in "${folder_path_vec[@]}"; do
|
|
# 迭代文件夹中的所有.sy文件
|
|
for file in "$folder_path"/*.sy; do
|
|
# 检查文件是否存在
|
|
if [ -f "$file" ]; then
|
|
# 删除文件中包含#include "sylib.h"的行,并将结果保存到临时文件中
|
|
grep -v '#include "sylib.h"' "$file" >"$file.tmp" && mv "$file.tmp" "$file"
|
|
fi
|
|
done
|
|
done
|
|
|
|
echo "已删除所有.sy文件中的#include \"sylib.h\"行"
|