Data
1
\begin{document}
3
Code
#!/bin/bash
function getStart {
local START="$(awk '/begin\{document\}/{ print NR; exit }' data.tex)"
echo $START
}
START2=$(getStart)
echo $START2
which returns 2
but I want 3
.
I change unsuccessfully the end by this answer about How can I add numbers in a bash script:
START2=$((getStart+1))
How can you increment a local variable in Bash script?
awk
?sed -n '/begin{document}/{=;q}' data.text
much shorter…}/{=;q}
this in an answer/comment, please?