#!/bin/bash

pattern=$1
shift

awk -v pattern="$pattern" \
  'BEGIN { FS="\n" ; RS=""; ORS="\n\n" }
    $0 ~ pattern { print $0 }
      ' $*
