I have a list of words in a string:
str="SaaaaE SeeeeE SbbbbE SffffE SccccE"
I want to reverse it in order to get
"SccccE SffffE SbbbbE SeeeeE SaaaaE"
How I can do that with ash?
ash
You can use awk as follows:
awk
echo "$str" | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }'
2.1m questions
2.1m answers
60 comments
57.0k users