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: [email protected] mail: [email protected]"
Want Below Parameters from the USER string as ->
UserId=dfl3030
Name=Reb Lena Schmidt
PwdExpiry=20200415235959Z
[email protected] ( 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.