#!/bin/bash eval "$(jq -r '@sh "lb=\(.lb)"')" RESULTS=$(aws elbv2 describe-target-groups --load-balancer-arn $lb --query TargetGroups[*].TargetGroupArn --output text --no-cli-pager | sed 's/\t/\n/g' | sort | xargs) jq -n --arg result "$RESULTS" '{"result":$result}'