names=('U_C-Bt^int' 'U_C-Ecd^int' 't_Ecd^int' 'p_H^int' 'SW_preion^int' 'TXT_Bt-gen' 'TXT_Ecd-gen' 'C_Ecd' 'C_Bt' ) number=8 function all { rm *.png pdflatex figs.tex convert -trim -density 300 figs.pdf -quality 90 fig-%d.png for i in `seq 0 $number`; do echo doing ${names[$i]} mv fig-$i.png ${names[$i]}.png done ls -all } all