alternatively, `grep -v '^#'` (though that can't do in-place, you'll need another tempfile. but the perl suggestion above also doesn't seem to do in-place)