#!/bin/sh WORLD=2 LEVELS="7 8 9 15" for l in $LEVELS; do cp world2/level${l}.dat world1/ORIG.level${l}.dat cat world2/level${l}.dat | awk -f fixlevel.awk > /tmp/$$ mv -f /tmp/$$ world2/level${l}.dat done