#get line number of occurrence in text file and then print out x lines from that point
#get the line number of the first occurrence of our search text
linenumber=`grep -n "someuniqueitem" inventory.txt|head -n1|cut -d ":" -f 1`
#linestop represents how many lines after the occurring line we want to print out in this case "20"
linestop=$((linenumber+20))
# sed prints out the line range we want for inventory.txt
# note that the p after $linestop tells sed to print
sed -n "$linenumber,$linestop p" inventory.txt
Combing it into one line:
linenumber=`grep -n "evodal07" inventory.txt|head -n1|cut -d ":" -f 1`&&sed -n "$linenumber,$((linenumber+20)) p" inventory.txt
bash, text, occurrence, linenumber, grep, quot, someuniqueitem, inventory, txt, linestop, represents, occurring, sed,