First made for make art 2009 posters.
Instead of selecting the graphics acccording to a fixed value (e.g. at step 65 select file 65), we use a method that works with any given number of files:
List all pdf-files in the tmp directory
with ls $TMP/*.pdf
, take the amount according to the current grid type with head -n $GRIDTYPE
,
take the amount according to the current step with head -n $GRAFIKCOUNT
, select the last one
with tail -1
.
while [ $GRAFIKCOUNT -le $MAXGRAFIKS ] do GRAFIK=`ls $TMP/*.pdf | head -n $GRIDTYPE | \ head -n $GRAFIKCOUNT | \ tail -1` GRAFIKCOUNT=`expr $GRAFIKCOUNT + 1` done
This way we get a file, wether there are 1 or 500 in the folder. If the generator script did not produce enough files, for any reason, there is no need to have an exception. This soft selecting method will compensate the error through. Errors will not cause stoppin but the change the visual output.