hello
input file contains many user stanzas in password file but some stanzas are not as expected separated by empty line (like in example below guest4,5,6 stanzas are not separated).
how to easily correct it in whole file to be able "grep -p ^username:" in this file?
I tested:
sed '/^.*:$/{x;p;x;}'
and
sed '/^.*:/{x;p;x;}'
I hope ":" will never happen in any type of password = and lastupdate =, flags = attributes.
can it be prevented extra in above command(s)?
input file contains many user stanzas in password file but some stanzas are not as expected separated by empty line (like in example below guest4,5,6 stanzas are not separated).
how to easily correct it in whole file to be able "grep -p ^username:" in this file?
I tested:
sed '/^.*:$/{x;p;x;}'
and
sed '/^.*:/{x;p;x;}'
I hope ":" will never happen in any type of password = and lastupdate =, flags = attributes.
can it be prevented extra in above command(s)?
Code:
guest3:
password = s.gtrwrwr545.
lastupdate = 1142355052
flags =
guest4:
password = z.GwvrwrrwjA
lastupdate = 1142355057
flags =
guest5:
password =
guest6:
password = F0wrwrwrwrF.
lastupdate = 1250607014
guest7:
password = yPorwrehfghI
lastupdate = 1250607020
flags =