I have a vendor process that creates output with random file names,
I am wanting to put some organization to it, consolidating this stuff into
one location after it's been used. I've have problems in the past with duplicate
files names, I think I may be on to a creation but want to run it by the scripts
gurus.
Here is what I am thinking, see if I am full of it.
#!/bin/sh
for fn1 in `ls -la |awk '{print $4}'
do
export fn2=`date +%Y%j%H%M%S`$fn1.ext
mv $fn1 $fn2
done
By doing this I am retaining the original name in the file name, but, creating a uniq file based on the "date stamp"
Anyone with a better way? or suggestions appreciated.