Dati
1
\begin{document}
3
Codice
#!/bin/bash
function getStart {
local START="$(awk '/begin\{document\}/{ print NR; exit }' data.tex)"
echo $START
}
START2=$(getStart)
echo $START2
che ritorna 2ma voglio 3. Cambio senza successo la fine con questa risposta su Come posso aggiungere numeri in uno script bash :
START2=$((getStart+1))
Come puoi incrementare una variabile locale nello script Bash?
awk? sed -n '/begin{document}/{=;q}' data.textmolto più breve ...
}/{=;q}in una risposta / commento, per favore?