#!/bin/bash
s="START
I'm trying to read a file from starting pattern till EOF.
In below example read from*** COPY public.objkeys( till EOF.
However few lines are missed out.
Not sure what is the cause.
END"
sed -n -e '/\*\*\* COPY public.objkeys/,//p' <<< "$s"
IyEvYmluL2Jhc2gKcz0iU1RBUlQKSSdtIHRyeWluZyB0byByZWFkIGEgZmlsZSBmcm9tIHN0YXJ0aW5nIHBhdHRlcm4gdGlsbCBFT0YuIApJbiBiZWxvdyBleGFtcGxlIHJlYWQgZnJvbSoqKiBDT1BZIHB1YmxpYy5vYmprZXlzKCB0aWxsIEVPRi4gCkhvd2V2ZXIgZmV3IGxpbmVzIGFyZSBtaXNzZWQgb3V0LiAKTm90IHN1cmUgd2hhdCBpcyB0aGUgY2F1c2UuCkVORCIKc2VkIC1uIC1lICcvXCpcKlwqIENPUFkgcHVibGljLm9iamtleXMvLC8vcCcgPDw8ICIkcyI=