I'm running into an issue with the read command. I'm trying to get read to run through the output of my awscli command to extract VPC_ID, VPC_CIDR and VPC_NAME. Unfortunately its no longer working since upgrading to bash 5.0.
Here is the following code:
read VPC_ID VPC_CIDR VPC_NAME <<<$(aws ec2 describe-vpcs --filters "Name=tag:Name,Values=${AWS_PROFILE}-vpc" --output json | jq -r '.Vpcs[] | .VpcId,.CidrBlock, (.Tags[]|select(.Key=="Name")|.Value)')
When I run aws ec2 describe-vpcs --filters "Name=tag:Name,Values=${AWS_PROFILE}-vpc" --output json | jq -r '.Vpcs[] | .VpcId,.CidrBlock, (.Tags[]|select(.Key=="Name")|.Value)'
I get my expected output but when I attached the read command in front of it, I'm only able to assign the first variable none of the other ones...
reada bit. Showing the output from the working command would let folks test on their own.