bash script to build all figure 8