#!/bin/ksh # Store minimum energy from each volume file skeng.xstrain in the file # c11-c12.eng. # Usualy disclaimers apply. Don't bet your life on this script. # We'll have to sort the xstrains after we get them all, so # create a new file c11-c12.1 rm -f c11-c12.1 touch c11-c12.1 # Now scroll through all the skeng files: for xfile in skeng.* do # Note that GNU sort doesn't do this quite right. I'll see if # I can figure out a workaround. # Also note that the energy better be in the fifth column, else # you'll be minimizing the Fermi energy sort -k4 $xfile | tail -1 >> c11-c12.1 done # Now sort on the first column: sort -n c11-c12.1 > c11-c12.eng rm c11-c12.1