I have following input:
almantas 31949 1 0 00:00:08 ? /usr/bin/pulseaudio -D --log-target=syslog
almantas 31979 12082 0 00:00:06 pts/2 bash
almantas 31991 31949 0 00:00:00 ? /usr/lib/pulseaudio/pulse/gconf-helper
almantas 32009 1 0 00:00:06 ? /usr/lib/libgconf2-4/gconfd-2
almantas 32166 31352 0 00:00:00 ? /usr/bin/seahorse-agent --execute x-session-manager
I need to replace one or more spaces with colon ":"
Syntax would be sed 's/ \+/:/g'
But i don't want to replace all spaces, just first six . I could do something like this sed 's/ \+/:/1' | sed 's/ \+/:/1' | sed 's/ \+/:/1' | sed 's/ \+/:/1' | sed 's/ \+/:/1' | sed 's/ \+/:/1'
How do i make sed repeat only 6 times? Like sed 's/ \+/:/1,2,3,4,5,6'
Output should be
almantas:31949:1:0:00:00:08:?:/usr/bin/pulseaudio -D --log-target=syslog
almantas:31979:12082:0:00:00:06
ts/2:bash
almantas:31991:31949:0:00:00:00:?:/usr/lib/pulseaudio/pulse/gconf-helper
almantas:32009:1:0:00:00:06:?:/usr/lib/libgconf2-4/gconfd-2
almantas:32166:31352:0:00:00:00:?:/usr/bin/seahorse-agent --execute x-session-manager