for ((i=000; i<010; i++)) do echo "$(printf '%04d' $i)"; done
for FILE in *.pdf; do pdfcrop $FILE; done
To work with arrays in a list
file=(hah1 hah2 hah3)
for list in "${file[@]}"; do echo $list; done
for ((i=28; i<243; i++)) do ((var= $i-$ii)); mv pv_"$(printf '%04d' $i)".jpg pv_"$(printf '%04d' $var)".jpg; done
for ((i=28; i<243; i++)) do ((var= $i-$ii)); mv pv_"$(printf '%04d' $i)".jpg pv_"$(printf '%04d' $var)".jpg; done
http://mywiki.wooledge.org/BashGuide/Arrays
Call list using loop variable
dirlist=(p45 p46 p46_highGam sigma0.01)
numlist=(0036 0033 0021 0060)
for i in "${!dirlist[@]}"; do
dir=${dirlist[$i]}
num=${numlist[$i]}
echo $dir $num
cd $dir/postprocess_20May2021
mv phi045deg045deg45deposit_2keV.$num.flt phi045deg0deposit_2keV.$num.flt
mv phi045deg045deg45deposit_2keV.$num.flt.StQ.flt phi045deg045deposit_2keV.$num.flt.StQ.flt
mv phi045deg045deg45deposit_2keV.$num.flt.StU.flt phi045deg045deposit_2keV.$num.flt.StU.flt
cd ../../
done