So you want to grep a file for a word, but don't want it to look in the first five lines? Well, there are a few ways though I'd reccommend python instead of bash. Python would be
Code:
#!/usr/bin/env python
#-*- encoding:utf-8 -*-
#
def worker(file, word):
try:
file = open( file ).readlines()[5:]
except:
print "File Does Not Exist"
raise SystemExit
for i in range( len( file) ):
if word in file[i]:
print file[i]
if __name__ == '__main__':
from sys import argv
try:
worker( argv[1], argv[2] )
except:
print """ Syntax:
%s file word
""" % ( argv[0] )
If you're dead set with bash, you could get the number of lines (see man wc), minus 5 and then tail that into a variable. Then you could grep through that.