#!/bin/ksh # Store minimum energy from each volume file skeng.volume in the file # hcp.eng. # Usualy disclaimers apply. Don't bet your life on this script. # First, get rid of any previous hcp.eng, and make sure a new one exists: rm -f hcp.eng touch hcp.eng # Now scroll through all the skeng files: for volfile 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 fourth column, else # you'll be minimizing who knows what sort -k4 $volfile | head -1 >> hcp.eng done