I have over a thousand compressed files inside each other, named in descending order starting at 1022; and need to extract all of them. What I'm trying to do is to write a shell script that will do just that. Here's what I've got so far:
cd "PATH"
for file in PATH/*; do
filename=${PWD: -4}
extract $file
numb=$(echo $filename - 1 | bc)
echo $numb
cd "$numb"
done
The "extract" function extracts any format of compression.
The problem is the loop doesn't seem to go on inside the new directory. Can anyone help me out with this?