Я сделал несколько анализов в программном обеспечении, и выходной файл похож на это:
ASReml 4.1 [28 Dec 2014] Analisys Build mx [05 Oct 2018] 64 bit Linux (x64)
31 Jan 2020 07:26:33.206 1024 Mbyte
*****************************************************************
* Contact support@asreml.co.uk for licensing and support *
*********************************************************** ARG *
Forming 136206 equations: 2 dense.
Initial updates will be shrunk by factor 0.316
Notice: Algebraic Denominator DF calculation is not available
Numerical derivatives will be used.
Notice: LogL values are reported relative to a base of -150000.00
Notice: 8 singularities detected in design matrix.
1 LogL=-5856.80 S2= 481.74 42059 df
2 LogL=-5617.63 S2= 443.14 42059 df
3 LogL=-5405.81 S2= 393.42 42059 df
4 LogL=-5323.54 S2= 353.37 42059 df
5 LogL=-5309.22 S2= 327.81 42059 df
6 LogL=-5308.88 S2= 321.50 42059 df
7 LogL=-5308.88 S2= 320.63 42059 df
- - - Results from analysis of weight - - -
Akaike Information Criterion 310623.75 (assuming 3 parameters).
Bayesian Information Criterion 310649.69
Я хочу скопировать значение последнего LogL и передать его в отдельный файл, то есть -5308.88, так как каждый анализ отличается, позиция LogL меняется, поэтому мне нужно условие. Я считаю, что принцип таков: paste <(awk 'FNR==12 {print $2}' df) >> file.results
, но, поскольку мне нужно условие для последнего значения LogL