I want to use tac or tail -r piped on the end of my shell command. I want to inverse the output of words but not completely reverse the character order.

Like output every word in this sentence last to first, but don't output the letters in reverse. How do you do this in shell? Rev does not do what I want it to it reverses everything. Bonus points if you can do it one line without outputting a file that's cheating.

cc @p @newt @dushman @charlie_root @nishi @meso @dcc

@splitshockvirus
cat input | xargs -n1 | tac | xargs
You will lose the newlines though — but I can't even formulate what preserving those would mean, reversing the order of words on every line, but keeping the line order intact? :marseyhmm:
@newt @dushman @charlie_root @nishi @meso @dcc
Follow

@splitshockvirus
Damn, my instance is overtaxed, I didn't even see your reply đŸ˜±
I mean I had to go to your instance to read it 😅
@m0xEE @dcc @charlie_root @dushman @nishi @newt @meso

· Web · 0 · 0 · 1
Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml