0

I want to split a string and need some parameters from it.

USER="dn: uid=dfl3030,cn=users,cn=accounts,dc=tenant,dc=ycs,dc=io cn: Reb Lena Schmidt krbpasswordexpiration: 20200415235959Z mail: arl0031@tenant.ycs.io mail: rebecca-lena.schmidt@arlanxeo.com"

Want Below Parameters from the USER string as ->

UserId=dfl3030
Name=Reb Lena Schmidt
PwdExpiry=20200415235959Z
Email=rebecca-lena.schmidt@arlanxeo.com ( Second mail not the first one)

The IFS ", " will delimit by comma and space only. I have long list of array which require splitting of string as mentioned above. Please someone can help me. I used cut as well but its getting complicated. If someone can help me using awk or have some better solution, please help me.

user2641452
  • 105
  • 2
  • 10

0 Answers0