Unable to use jq command

Asked 2 years ago, Updated 2 years ago, 94 views

1. When creating vpc in cli, the jq command was used and the vpcid output was successful.

Enter a description of the image here
2. There was a problem enabling the DNS hostname
Enter a description of the image here
3. The echo$vpcid should print the defined vpcid, but nothing
Enter a description of the image here

linux shellscript

2022-09-30 17:30

1 Answers

1. When creating vpc in cli, the jq command was used and the vpcid output was successful.

This is not a value setting for the variable vpcid, but simply the string vpcid= followed by the command execution results below awsec2.

Use the jq command to create the vpc in 1.cli, and immediately after the vpcid output without any problems

 echo$vpcid

3.echo$vpcid should print the defined vpcid, but it should be the same as the empty .

If you divide the substitution into variables and echo as follows, you will get the desired result.

vpcid=$(awsec2 and below...)
echo$vpcid


2022-09-30 17:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.