perl -ne "BEGIN{$pattern = shift} print if /\Q$pattern\E/o" pattern file.log