'trying to find a way to bash script my results
I have a testResultOuput.txt which contains lines that look like this:
[2022.03.03-13.28.59:742][394]LogAutomationController: Error: Test Completed. **Result={Failed}** **Name={MyAwesomeTest}** Path={AutoTests.UnitTests}
[2022.03.03-13.28.59:742][394]LogAutomationController: BeginEvents: AutoTests.UnitTests
[2022.03.03-13.28.59:742][394]LogAutomationController: Error: Expected 'MyAwesomeTest' to be 0.000000, but it was -2147483648.000000 within tolerance 0.000100.
and so far I find these lines with: & grep Result={Failed} testResultOuput.txt
anyone can help?
I want to write a shell script to search by Result and print only the Name={} and Result={} from these lines
Solution 1:[1]
How about this:
$ grep -o '\<Result={[^}]*} Name={[^}]*}' testResultOutput.txt
Result={Failed} Name={MyAwesomeTest}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Greg Barrett |
