All,
OK! Trying to move image file to central images folder. Here is my script:
img_dir='/home/filies/images/'
img_fil='/home/files/img_dump.txt'
i='0'
while read -r fline
do
fpath=$(dirname "$fline")"/"
fname=$(basename "$fline")".$i"
nfile="$img_dir$fname"
if [ ! -e "$nfile" ]; then
# mv "$fline $img_dir$nfile"
echo "NF=> $nfile"
else
((i++))
# mv "$fline $img_dir$nfile.$i"
echo "F=> $fname P=> $fpath"
fi
done < ${img_fil}
exit
File moves currently commented out, till I get this right or have at least a likable result.
There are dups and my current script will not increment the counter for just the dupes of the same filename but for every dupe occurrence.
Is there a better way to do this and/or can I create a subroutine that does a search in the new image dir to find the latest increment number?
Cheers
OMR