Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
you can remove it with the second grep filter:
grep -A 1 'ABCD' test.txt | grep -v 'ABCD'
7777
naturally, if the second line (which we want to save) also contains ABCD, then you need to modify the second grep to find something that is not there ... but the principle remains the same
you can without too much witchcraft)))
grep -A 1 'ABCD' test.txt | tail -n 1
BUT if there are several lines with 'ABCD'??? :(
It is possible like this:
$ awk '{line = $0}; END {print line}' text.txt
вывод в констоль:
777
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question