jqlang / jq

Command-line JSON processor
https://jqlang.github.io/jq/
Other
30.3k stars 1.57k forks source link

error parsing, while the command executes successufully on other instances #2335

Closed mmkholy7 closed 3 years ago

mmkholy7 commented 3 years ago

Describe the bug

I am running this command: aws ec2 describe-availability-zones --region ca-central-1 | jq '.AvailabilityZones[]|(.ZoneName)' on 2 identical macOS and one Amazon Linux

The macOS subject to this issue is showing this error : "parse error: Invalid numeric literal at line 1, column 18"

However, the Amazon and the Other macOS are showing the right output enter image description here

"ca-central-1a" "ca-central-1b" "ca-central-1d"

To Reproduce aws ec2 describe-availability-zones --region ca-central-1 | jq '.AvailabilityZones[]|(.ZoneName)' on 2 identical macOS and one Amazon Linux output: parse error: Invalid numeric literal at line 1, column 18

Expected behavior "ca-central-1a" "ca-central-1b" "ca-central-1d"

Environment (please complete the following information): -macOS 11.4

Additional context Add any other context about the problem here.

mmkholy7 commented 3 years ago

The issue was in the output defaulted to YAML and not JSON. Once changed, the output is as expected.