Getting the line number of the nth match
---
title: some frontmatter
--- <-- We want the line number of this line
# Some contentgrep '^---$' -m 2 -n input.md | tail -1 | cut -d ":" -f 1awk '/^---$/ && (++c == 2) { print NR; exit }' input.mdLast updated