Computing.Net > Forums > Unix > multiple grep

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

multiple grep

Reply to Message Icon

Name: mgonzalo
Date: February 21, 2008 at 04:12:57 Pacific
OS: HP-UX
CPU/Ram: HP
Product: B.10.20 A 9000/785
Comment:

have the following file

dn: CN=IP,OU=corporativos,OU=grupos,DC=zasdf,DC=es
displayName: INGENIERIA DEL PRODUCTO
managedBy: CN=MQG,OU=Pasados,OU=madrid,OU=zasdf,OU=usuarios,DC=zasdf,DC=es
mail: didp@zasdf.es
dn: CN=IN,OU=corporativos,OU=grupos,DC=zasdf,DC=es
displayName: INGENIERIA DEL NUCLEO
managedBy: CN=JAN,OU=Pasados,OU=madrid,OU=zasdf,OU=usuarios,DC=zasdf,DC=es
mail: dinucleo@zasdf.es
dn: CN=CBWR,OU=corporativos,OU=grupos,DC=zasdf,DC=es
displayName: COMERCIAL BWR
mail: CBWR2@zasdf.es
dn: CN=CPWRE,OU=corporativos,OU=grupos,DC=zasdf,DC=es
displayName: COMERCIAL PWR EUROPA
managedBy: CN=MMN,OU=Pasados,OU=madrid,OU=zasdf,OU=usuarios,DC=zasdf,DC=es
mail: cpwre@zasdf.es
dn: CN=SMM,OU=corporativos,OU=grupos,DC=zasdf,DC=es
displayName: SERVICIO MEDICO MADRID
managedBy: CN=LLS,OU=Pasados,OU=madrid,OU=zasdf,OU=usuarios,DC=zasdf,DC=es
mail: smed@zasdf.es
dn: CN=OTGC,OU=corporativos,OU=grupos,DC=zasdf,DC=es
displayName: OFICINA TECNICA Y GARANTIA DE CALIDAD
managedBy: CN=JRS,OU=general,OU=saelices,OU=zasdf,OU=usuarios,DC=zasdf,DC=es
mail: OTGC@zasdf.es
dn: CN=DPI,OU=corporativos,OU=grupos,DC=zasdf,DC=es
...................................
....................................
....................................


this formed by groups of 4 lines

dn: CN=??,OU=corporativos,OU=grupos,DC=zasdf,DC=es
displayName: ???????????
managedBy: CN=???,OU=Pasados,OU=madrid,OU=zasdf,OU=usuarios,DC=zasdf,DC=es
mail: ????@zasdf.es


and I want to take out information of each it lines

for example

CN=
displayName:
managedBy:
mail:

as I make it?
I am proving with xxx and I see that with I can not make it and with awk not him you to make

Thanks


"La experiencia es algo maravilloso. Nos permite reconocer un error cada vez que lo volvemos a cometer.", Franklin P. Jones



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: multiple grep

multiple unix commands in 1 session www.computing.net/answers/unix/multiple-unix-commands-in-1-session/8297.html

grep search in multiple dirs www.computing.net/answers/unix/grep-search-in-multiple-dirs/7710.html

scripting with grep www.computing.net/answers/unix/scripting-with-grep/4222.html