perl -wpe 'if ((/\bremotely\b/.../\bp_args\b/) !~ /^$|E0/) { chomp }' a #### perl -wpe 'if (($_f ||= /\bremotely\b/) &&= !/\bp_args\b/) { chomp }' a