1#!/bin/sh 2 3for F 4do 5 { grep '^#' "${F}"; grep -v '^#' "${F}" | LC_ALL=C sort ;} > "${F}".tmp 6 mv "${F}".tmp "${F}" 7done 8