Still, bash can try to keep up using json.bash. :)
$ source json.bash $ declare -A greeting=([Hello]=World) $ json ...@greeting:{} {"Hello":"World"}
Without the ... the greeting would be a nested object. Probably more clear with multiple entries:
$ declare -A greeting=([Hello]=World [How]="are you?") $ json @greeting:{} {"greeting":{"Hello":"World","How":"are you?"}}
$ json ...@greeting:{} {"Hello":"World","How":"are you?"}
$h=@{x=1; y=2}; $h + @{z=3} | ConvertTo-Json { "y": 2, "z": 3, "x": 1 }
reply
Still, bash can try to keep up using json.bash. :)
... is splatting the greeting associative array entries into the object created by the json call.Without the ... the greeting would be a nested object. Probably more clear with multiple entries:
Vs: