I'm using a supercomputer which is using the famous #PBS. My walltime is 48 hours and this is not enough to process million files.
My file names are like :
AAAAAA.pdb
DAAAAA.pdb
EAAAAA.pdb
FAAAAA.pdb
...
All possibles letters are "A D E F G H I K L M N P Q R S T V W Y".
I want to use a script like this :
for file in /dir/*
do
cmd [option] $file >> results.out
done
But I must use a restart for the wall time. With numbers I would have put a counter but with specific letters I don't know how to write the last file to start from this checkpoink. Like :
if [ -f next.seq ]; then
seq=`cat next.seq`
else
...
for file in /dir/seq
do
cmd [option] $file >> results.out
done
...
let seq=seq+1
echo $seq > next.seq