sed could be better:
sed -n '/PATTERN/,/^$/p' file
To avoid printing an empty line:
sed -n '/PATTERN/,/^$/{/^$/d; p}' file
or even better - thanks jthill! :
sed -n '/PATTERN/,/^$/{/./p}' file
Above decisions will be issued more than necessary if PATTERNappears more than once. To do this, it is better to stop working after an empty string is found, since jaypal answer :
sed -n '/PATTERN/,/^$/{/^$/q; p}' file
Explanation
^$ , ^ $ . , ^$ : , ./PATTERN/,/^$/{/^$/d; p}/PATTERN/,/^$/ PATTERN .{/^$/d; p} (d) , ^$, (p) .
{/./p} , .
awk :
awk '!NF{f=0} /PATTERN/ {f=1} f' file
, sed, PATTERN, . , :
awk 'f && !NF{exit} /PATTERN/ {f=1} f' file
!NF{f=0} (.. ), f./PATTERN/ {f=1}, PATTERN, f.f f, , awk : .
Test
$ cat a
aa
bb
hello
aaaaaa
bbb
ttt
$ awk '!NF{f=0} /hello/ {f=1} f' a
hello
aaaaaa
bbb
$ sed -n '/hello/,/^$/{/./p}' a
hello
aaaaaa
bbb