jeudi 2 novembre 2017

print only the pattern in the whole line using grep

As i know to print only the pattern using command grep -o. i have a file like this:

Job <472971> Job Name <aaaaaaaaaaa> User <bbbbbbbbb> Project <cccccc> Status <RUN> Queue <AL_Ptime>Interactive pseudo-terminal shell mode Submitted from host <lsf_login07> CWD </asdfghjklll/dsadasd/asda>

i want to print out all the pattern inside < > , my desire output look like this:

<472971> <aaaaaaaaaaa> <bbbbbbbbb> <cccccc> <RUN> <AL_Ptime> <lsf_login07> </asdfghjklll/dsadasd/asda>

I tried a lot but i can print out exactly pattern < >.

Thanks for your help!

Aucun commentaire:

Enregistrer un commentaire