#!/bin/sh while [ $# != 0 ]; do ( grep '^#' $1; grep -v '^#' $1 | LC_ALL=C sort ) > $1.tmp mv $1.tmp $1 shift done