% perl -ne 'print if /^banana$/ .. /^grape$/' fruit.txt banana pear peach grape % cat fruit.txt apple banana pear peach grape orange