/
hubbitus
/
shell.scripts
Обзор
Документация
Войти
/
hubbitus
/
shell.scripts
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
convert_all_images
25 строк
991 B
Pavel Alexeev
Recommit files after recovery Subversion repository from crash
29 ноя 2010, 02:14
29 ноя 2010, 02:14
7d907c2
Код
Авторство
О чём код?
#!/bin/bash #INDIR=skin_images #OUTDIR=skin_images.small #INDIR='/mnt/_NET/Server-red/Ирина Старосельцева/МАГАЗИН/КАМИНЫ/Jotul/ДИСК' #OUTDIR='/mnt/_NET/Server-red/Ирина Старосельцева/МАГАЗИН/КАМИНЫ/Jotul/ДИСК.small' INDIR='/mnt/_NET/Server-red/СОТРУДНИКИ/Pasha/_Irina/Images' OUTDIR='/mnt/_NET/Server-red/СОТРУДНИКИ/Pasha/_Irina/Images.small' # 0-terminated list of files: http://stackoverflow.com/questions/513611/xargs-doesnt-recognize-bash-aliases shopt -s extquote time find "$INDIR" -iname '*.jpg' -print0 | \ while read -d $'\0' file; do trfile="$(echo `basename "$file"` | translit | tr ' ' '_' | sed 's#\.JPG#.jpg#g;s#\.jpg\.jpg#.jpg#g')" subdir=$( echo `dirname "$file"` | sed "s#^$INDIR##" ) echo "Processing $file ($OUTDIR/$subdir/$trfile)" # echo trfile=$trfile # echo subdir=$subdir mkdir -p "$OUTDIR/$subdir" gm convert -resize 350x350 "$file" "$OUTDIR/$subdir/$trfile" done