guys! I am trying to exchange two words in a line but it doesn\'t work. For example: \"Today is my first day of university\" should be \"my is Today first day of university\"
I start to make it with \s
which means any whitespaces chars.
I use it for match every words with [^\s]*
which match with everything but not spaces.
And I had \s*
for match withspaces between words. And don't forget to rewrite a space in replacement.
Look a this for an example:
sed 's#\([^ ]*\)\s+#\1 #'
( I use #
instead of /
)