I have a text file title 'results' and it contains
[ PASSED ] 11 tests.
[ PASSED ] 590 tests.
[ PASSED ] 1231 tests.
[ FAILED ] 4 tests.
[ FAILED ] 500 tests.
I would like to add the PASSED tests and store into a variable. Add the FAILED tests, add them and store into another variable.
How can I do this?
awk.casestatement.bash:. Why do you want to do this inbash? It seems easier to write a smallawkscript, and run store the awk script's output in a bash variable.