I am trying to process a file
File: /var/log/audit/audit.log:
/var/paas/sys/log/kubernetes/audit.log
/var/paas/sys/log/csms-storagemgr/audit.log
File: /var/log/sudo.log: Good
File: /var/log/secure: Good
For lines not started with 'File:', I need to combine it with above line
Expected result will be
File: /var/log/audit/audit.log /var/paas/sys/log/kubernetes/audit.log /var/paas/sys/log/csms-storagemgr/audit.log
File: /var/log/sudo.log: Good
File: /var/log/secure: Good
How to achieve this goal with sed
or something other tools for it?
I have tried with
sed -ne '/File:/{:a;N;/File:/!{ba};s/\n/\t/g;p}' /tmp/test
but it failed.