in reply to Re^4: Join lines that match an string
in thread Join lines that match an string

I am confused. If I copy the posted file:

EV = 0x10eb250 (class, event_handle: 3503519, mc_ueid: 1278629168) 20100708 224608.259843 RULES: IMC110203I: #3503519: $EV.m c_host 20100708 224608.260757 RULES: IMC110801I: #3503519: Rule e execution starting with . . . msg='script to be execute remotely: exists("TRUSTEDALARM"); Local Id: Rem_010965WAP_18504'; . . . p_agrs

into the file 'input.txt' and then execute the command

perl -e 'while(<>){chomp; last if /p_agrs/;print if /remotely/}' < input.txt

I get the output

msg='script to be execute remotely:

Is this not consistent with what you observe?