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

22
SH/removeblank.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
BASE_DIR="."
find "$BASE_DIR" -depth | while IFS= read -r path; do
current_name=$(basename "$path")
parent_dir=$(dirname "$path")
# Loại bỏ ký tự đặc biệt: # ! ' [ ] @ bằng tr + tr -d
new_name=$(echo "$current_name" | tr -d "#!'\[\]@")
# Loại bỏ khoảng trắng thừa (chỉ giữ 1 dấu cách, loại bỏ cuối)
new_name=$(echo "$new_name" | tr -s ' ' | sed 's/ *$//')
# Nếu tên thay đổi thì đổi tên
if [[ "$current_name" != "$new_name" ]]; then
mv -- "$path" "$parent_dir/$new_name"
echo "Đã đổi tên: '$path' → '$parent_dir/$new_name'"
fi
done
echo "✅ Hoàn thành."