I'm having a few problems removing multiple occurrance of whitespace with a ':'.
Here's the string:
8 contact_name jsmith
As you can see, there's a lot of whitespace. What I'd like to do is remove the whitespace and substitute a ':' in it's place, so it looks like this:
So, in short I'd like to:
- Remove the whitespace at the front
Substitute the remainding whitespace with a ':'
cat userlist | sed -e 's/[ ]/:/'
cat userlist | sed -e 's/[ ]/:/g'
...but can't quite get it right. Any ideas? This is driving me crazy!