AIX系统正则匹配指定字符串后n行

需要提取指定字符串后n行
linux系统内支持grep -A -B参数在AIX系统不支持
有没有知道在AIX linux系统中通用的方法

例子:
文件名称:mysql.txt
内容:
qwewe
qwesdx
sadasd
asdasdfdsadsadag
asdasdhh
asghjgds
sadadagvx
sadadas;
ssafcxz,
saddasdawwq
提取asghjgds后三行


grep -A 3   "asghjgds" mysql.txt


-i表示忽略大小写,可以去掉grep -A 3  -i "asghjgds" mysql.txt
使用grep命令可以比较轻松达到目的,具体使用如下:
$ grep -A|B n "key" file
其中:
A:表示在字符串之后 after  context
B:表示在字符串之前 before context
n:要获取多少行文本 line number
key:为要查找的字符串
file:文件名