Skip to content

Instantly share code, notes, and snippets.

View fofosudarko's full-sized avatar

Frederick Ofosu-Darko fofosudarko

View GitHub Profile
@fofosudarko
fofosudarko / make-archives-of-batched-number-of-files.sh
Last active October 13, 2019 17:58
Make archives of batched number of files
FILES_TO_BATCH=`dir -1t *{jpeg,png}|tr ' ' '@'`;
NUMBER_OF_FILES_TO_BATCH=`echo $FILES_TO_BATCH|tr ' ' '\n'| wc -l`;
BATCH_SIZE=10;
ARCHIVE=production-assets;
INDEX=1;
ITERATIONS=`expr $NUMBER_OF_FILES_TO_BATCH / $BATCH_SIZE + 2`;
until [[ "$INDEX" == "$ITERATIONS" ]];
do
START_POINT=$(((INDEX * BATCH_SIZE - BATCH_SIZE) + 1));