I have written a bash script that performs 100 iterations of a programme. The output for each of these iterations has 14 lines, but I only need the 14th one for the rest of my analyses (AKA the last line).
I've read the answers to similar questions, but they all assume named lines for the output; whereas the 10th line of my output looks like this:
1 0 0.005 63.01
With no name for
grep to hold on to.
I would like to take this 10th line, and for each iteration done in the bash script, attach the output to the bottom of another file (
total_output.txt) like so:
left right p-value ratio 1 0 0.005 63.01 1 0 0.02 67.23
And so on for each iteration. Preferably, this would be in the same bash script as well and without having to save out the programme output for each iteration.
I'm still pretty new to Linux and bash scripting, so apologies if this question seems stupid. I couldn't really understand how to apply the answers to similar questions to my problem.