I need something which reverts words in a sentence in opposite order. I am sure it is possible to do without writing a script.
Something which receives an input stream like echo AAaa BBbb CCcc | foo and prints CCcc BBbb AAaa
Sorry, I changed the example, the words themselves should not be reverted. So, rev does not work
well when I saw this question, I thought tac or rev too. however I guess OP made a bad example with AAA BBB. he may want to revert “word”s but not all characters.
see this, if it is what you want: