sysy-data/scripts/add_incs.sh

11 lines
288 B
Bash
Raw Normal View History

2024-06-02 22:04:54 +08:00
#!/bin/bash
# Specify the directory
dir="."
# Loop over all .sy files in the directory
find "$dir"/*/sy -type f -name "*.sy" -print0 | while IFS= read -r -d '' file; do
# Use sed to add #include "sylib.h" at the beginning of each file
sed -i '1i#include "sylib.h"' "$file"
done