I have a .txt file with 20 lines, and would love to get the last two letters of each line. it equals AA in every line then print Good. if not, print Bad.
line11111111111111111 AA line22222222222222222 AA line33333333333333333 AA ..................... line20202020202020202 AA This is GOOD.
===========================
line11111111111111111 AB line22222222222222222 AC line33333333333333333 WD ..................... line20202020202020202 ZZ This is BAD.
Did this but needs improvement : sed 's/^.*\(.\{2\}\)/\1/'