How to replace space using sed in shell script
I want to use sed to replace multiple spaces with single character(say : ).
12:Mit 23627 83763 tty message
suppose the file test.txt contains the line as above and i want to replace all spaces with : so that the outcome should be like below:
i have used
sed 's/ /:/g' test.txt
but this command replacing every single space with a :, so the output is like: