RECORDS=$(aws route53 list-resource-record-sets --hosted-zone-id $HOSTED_ZONE_ID \
| $JQ -r '.ResourceRecordSets[] | select (.Name == "ap.com.") | .Name')
The Output value from $RECORDS prints in the format shown below in separated lines.
>> echo "recordType: $RECORDS"
recordType: ap.com.
ap1.com.
ap2.com.
How to print output in the format as (in inverted commas separating by comma)
>> echo "recordType: $RECORDS"
recordType: "ap.com, ap1.com, ap2.com"