#!/bin/bash # exclude ASG instances RESULTS=$(aws opensearch list-domain-names --query DomainNames[*].DomainName --output text --no-cli-pager | sed 's/\t/\n/g' | sort | xargs) jq -n --arg result "$RESULTS" '{"result":$result}'