Conteúdo do arquivo:
username:[email protected]:password:salt user:name:[email protected]:password:salt username:[email protected]:password:sa:lt user:name:[email protected]:password:sa:lt
Com o GNU sed:
sed -E "s/(.*):([^:]*@[^:]*):([^:]*):(.*)/', '', '', '/" file
Saída:
username', '[email protected]', 'password', 'salt user:name', '[email protected]', 'password', 'salt username', '[email protected]', 'password', 'sa:lt user:name', '[email protected]', 'password', 'sa:lt