We are writing a bash script which basically does the job of python dictionary. Below is the code siffet we are using and the expected output.
#!/bin/bash
declare -A serviceTag
serviceTag["source"]="ccr"
declare -A services
services+=( ["dataservice"]="latest" )
serviceTag+=( ["services"]=services )
echo "$serviceTag"
The expected output is
{"source":"ccr","services":{"datasetvice":"latest"}}
But what we are getting is
ccrservices
Can somebody help us in what mistake we are doing here and how can we achieve this using bash and its code?
Regards, Kanthu