I have a long string and from that string I want to extract a value of a key and store it in a variable. I want to extract value of userName
from abc
string. I tried below code but it say's file name too long error.
abc="Create [newSystem=System [identityDomain=bbundlesystemser201201-test, admin=AdminUser [firstName=BSystemAdminGivenName, middleName=null, lastName=BSystemAdminFalilyName, userName=bbundlesystemadminusername, password=*******, email=hello@example.com], idmConsoleURL=https://abc.com.jspx, sftpHost=d910.abc.com, sftpUser=3pyylzoo, sftpPwd=*******]]"
echo $abc
sed -n 's/^userName= //p' "$abc"
Is there anything wrong I am doing? I want to extract value of userName
and store it in a variable.
userName=bbundlesystemadminusername