Update code

This commit is contained in:
2025-08-20 23:33:52 +07:00
parent 7e99b228f5
commit a02171820c
29 changed files with 553 additions and 0 deletions

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