I need to take a series of image files, all numbered consecuativly, that were recently dumped in a directory and rename them to pieces of the directories path. Assume all directories are structured as this one so that I may use this script to easly sort and rename files.
pt.1
path : /home/shots/pic/seasons/winter/snowy
I need the script to recognize pieces of the path as variables to the images new name.
pt.2
path : /home/$NAME/pic/seasons/$SEASON/
I then need the file which is named xyxy.1.tif to be named in the following convention
pt.3
name : $NAME_$SEASON.0001.tif
the number needs to be repadded with 4 digits
I have been hacking at it for the past two days and have comeup with a rather large mess and have finally broken down and called out for help. I had it half working in Perl my knowlege of that is even more limited then the BASH shell. Thanks