And just to prove there's loads a ways to skin a cat:
Program:
Code:
#!/bin/sh
echo -n "File:"
read file
cat $file | sed -n '/#student layout/{n;n;n;n;p;}'
exit 0
test data:
Code:
# cat tmp.dat
line 1
#student layout
line 3
line 4
line 5
line 6
#student layout
line 9
line 10
line 11
line 12
line 13
#student layout
Output:
Code:
# ./tmp
File:tmp.dat
line 6
line 12