Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"
- userName=bbundlesystemadminusername
- $ declare -A a
- $ while IFS== read k v; do a["$k"]="$v"; done < <(grep -oEi '[a-z]+=[^], ]+' <<<"$abc")
- $ printf '%qn' "${a[userName]}"
- bbundlesystemadminusername
- [[ $abc =~ userName=([^][,[:space:]]+) ]] && userName="${BASH_REMATCH[1]}"
- echo "$userName"
- bbundlesystemadminusername
- userName=$(sed 's/.*userName=([^][,[:space:]]*).*/1/' <<< "$abc")
Add Comment
Please, Sign In to add comment