#!/bin/bash # # Script copies unordered files from src dir to ordered # files in destdir. File names generated by simple counter. # Src File names extracted from html file that contains # the correctly ordered list. # # 2004-12-06, stefanrufer.ch# extract src filenames from html file. html contains filenames in correct order LIST=`cut --delimiter=" --fields=11 index.html | grep jpg` # echo $LISTDEST_DIR=dest SRC_DIR=images# clear destination directory rm $DEST_DIR/*# start counter high enough so we don't need leading zeroes CNT=1000# copy loop for SRC_FILE in $LIST do echo copying $SRC_DIR/$SRC_FILE to $DEST_DIR/$CNT.jpg cp $SRC_DIR/$SRC_FILE $DEST_DIR/$CNT.jpg # counting in bash - didn't know this before let CNT=$CNT+10 done
| snipsnap-index | Linux | Virtual Brain | Linux |
| Mo... |