RosettaCodeData/Task/Reverse-words-in-a-string/Sed/reverse-words-in-a-string.sed
2023-07-01 13:44:08 -04:00

7 lines
112 B
Sed

#!/usr/bin/sed -f
G
:loop
s/^[[:space:]]*\([^[:space:]][^[:space:]]*\)\(.*\n\)/\2 \1/
t loop
s/^[[:space:]]*//