Files
Documentation/Moodle/Tools/removeeng.sh
2025-08-20 09:47:42 +07:00

14 lines
483 B
Bash

#!/bin/bash
# Quét các file k?t thúc b?ng .en.vtt, .vi.vtt ho?c .srt
find . -type f \( -name "*.en.vtt" -o -name "*.vi.vtt" -o -name "*.srt" \) -print0 | while IFS= read -r -d $'\0' file; do
# Ki?m tra xem tên t?p có ch?a ' English' không
if [[ "$file" == *" English."* ]]; then
# Ð?i tên file b?ng cách xóa ' English' tru?c ph?n m? r?ng
newfile=$(echo "$file" | sed 's/ English\././')
# Ð?i tên t?p
mv "$file" "$newfile"
echo "Ðã d?i tên: \"$file\" ? \"$