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

16 lines
555 B
Bash

#!/bin/bash
# Quét toàn bộ file *.vtt (trừ *.en.vtt và *.vi.vtt) trong thư mục hiện tại và thư mục con
find . -type f -name "*.vtt" ! -name "*.en.vtt" ! -name "*.vi.vtt" | while read file; do
# Tạo tên file mới bằng cách thay .vtt thành .en.vtt
new_file="${file%.vtt}.en.vtt"
# Copy nội dung sang file mới
cp "$file" "$new_file"
# Hiển thị thông báo
echo "Đã tạo: $new_file"
done
echo "Hoàn thành sao chép tất cả các tệp .vtt thành .en.vtt (trừ *.en.vtt và *.vi.vtt)"