Fix quoting of PATTERN - it clearly needs to substitute $1 in