up
This commit is contained in:
2025-09-14 23:13:06 +07:00
parent ee892854a6
commit 9690ed5634
80 changed files with 8417 additions and 0 deletions

14
SH/rename_topics.sh Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Lấy thư mục hiện hành nơi người dùng đang gọi lệnh
TARGET_DIR="$(pwd)"
# Đổi tên các thư mục con cấp 1 theo mẫu: 1 - ABC → 1. ABC
find "$TARGET_DIR" -mindepth 1 -maxdepth 1 -type d -regextype posix-extended -regex '.*/[0-9]+ - .+' | while read dir; do
base=$(basename "$dir")
newname=$(echo "$base" | sed -E 's/^([0-9]+) - (.+)$/\1. \2/')
if [ "$base" != "$newname" ]; then
echo "🔁 Đổi tên: $base$newname"
mv "$TARGET_DIR/$base" "$TARGET_DIR/$newname"
fi
done