#!/usr/bin/env bash # feed sample lines into grep without a real file printf '%s\n' apple banana cherry apricot | # print only the lines that contain "ap" grep 'ap'
match lines containing a pattern