change testing of $1 and use GNU sed