Can I combine below mentioned grep commands using OR (when searching strings having spaces)

Command 1: 
$script | grep 'Write to  ECC( SSID=MARGIN)'
Command 2: 
 $script | grep 'is not greater than existing logical processing'

The above commands run my script and search the mentioned strings but I do not want to run my script twice. It is increasing run time.

Can someone tell me some other way of combining these two commands.

The below won't work-

$script | grep 'Write to ECC( SSID=MARGIN)|is not greater than existing logical processing'

Hi,

you are missing \ for basic grep to use or.

$script | grep 'Write to  ECC( SSID=MARGIN)\|is not greater than existing logical processing'

Hello Tanu,

Could you please try to use grep 's -E option by joining both searches with | only and let me know how it goes then.

Thanks,
R. Singh

Many if not all grep take newline separated search patterns

$script | grep 'Write to  ECC( SSID=MARGIN)
is not greater than existing logical processing'

fgrep (plain string search) might be more appropriate than grep (RE pattern search).