grep -F "$name" -A1000 filename | sed -n '1p;19p;24p'
Assume let a=10,b=20,c=30
.In the above grep command can I use '$ap;$bp;$cp'
instead of '1p;19p;24p'
?
Another thing, I've given as -A1000
. Which implies that starting from 1p it considers till 1000 line , right? I need to search throughout file without giving the number.