Просто используйте оператор «-or»:
#Find and Move backup files older than the time constraint defined
find $Path_Backup_Dir -type f -mtime $Time \( -name *sql.gz -or -name *sql \) | while read file
do
echo "Earlier Backup $file will be moved to archive folder." >> $Path_Log_File
mv -f $file $Path_Mysql_Archive
done
Вы можете сделать все с помощью одной команды:
find $Path_Backup_Dir -type f \( -name *.sql -or -name *.sql.gz \) -exec mv -f -v {} /tmp/test2 \; >> $Path_Log_File
Вы должны окружить команду find ... с помощью $( ), чтобы заменить вывод следующим образом:
for i in $( find . -type f -iname '*.wmv` ) ; do ...
Однако вы заставляете Bash производить (и хранить внутри) список из 120 860 имена файлов, прежде чем обрабатывать первый. Также (вы не описали формат имен файлов), этот метод смешивает имена файлов с пробелами в них, например. [F6].
Прочитайте man find, особенно о --print0, прочитайте man xargs, особенно о -0, прочитайте man bash и завершите свою команду в скрипте, который запускает uniconverter на каждом из своих аргументы и используйте что-то вроде:
find . -type f -iname '*.wmv' -print0 | xargs -0 thescript
Обязательно прочитайте man bash и будьте в курсе любых пространств в ваших именах.
@steeldriver: TQ для указания моего ошибка. Чтение man bash показывает:
Enclosing characters in double quotes preserves the literal value of
all characters within the quotes, with the exception of $, `, \, and,
when history expansion is enabled, !. The characters $ and ` retain
their special meaning within double quotes. The backslash retains its
special meaning only when followed by one of the following characters:
$, `, ", \, or <newline>. A double quote may be quoted within double
quotes by preceding it with a backslash.
Итак, я передумал расширение Shell.