You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nudt-compiler-cpp/overwrite_src.sh

18 lines
445 B

#!/bin/bash
SRC_DIR=~/compile/compiler/nudt-compiler-cpp/src
DST_DIR=~/compile/compiler/nudt-compiler-cpp/warning/src
count=0
find "$SRC_DIR" \( -name '*.cpp' -o -name '*.h' \) | while read -r file; do
rel_path="${file#$SRC_DIR/}"
if [ -f "$DST_DIR/$rel_path" ]; then
cp "$file" "$DST_DIR/$rel_path"
echo "Replaced: $rel_path"
count=$((count + 1))
fi
done
echo "Done. $count file(s) replaced in $DST_DIR"