Exit correctly if file cannot be opened in cat