更新时间:2023-11-23 14:24:46
您可以为此使用awk:
You can use awk for this:
awk '/chicken/{++n; if (n==2) { print NR; exit}}' file 4
shell脚本查找字符串的第n个出现位置并打印行号