kislyuk / yq

Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
https://kislyuk.github.io/yq/
Apache License 2.0
2.57k stars 82 forks source link

Output of yq contains three dash (---) on Amazon Linux 2 #128

Closed macrovve closed 3 years ago

macrovve commented 3 years ago

Here is my YAML file effectiveConfig.yaml

---
system:
  certificateFilePath: "/greengrass/v2/thingCert.crt"
  privateKeyPath: "/greengrass/v2/privKey.key"
  rootCaPath: "/greengrass/v2/rootCA.pem"
  rootpath: "/greengrass/v2"
  thingName: "test-1"

When I run below command on Amazon Linux 2, the output will contain ---

[root@hostname ~]# yq e '.system.thingName' effectiveConfig.yaml
---
test-1

But If I run same command with same file on Ubuntu, the output won't contain ---

root@hostname~# yq e '.system.thingName' effectiveConfig.yaml
test-1

Version for Ubuntu:

$ yq -V
yq version 4.9.6

Version for Amazon Linux 2

# yq -V
yq (https://github.com/mikefarah/yq/) version 4.10.0
dosmanak commented 3 years ago

You are in the wrong repo then :-) This yq is in python. Refere to https://github.com/mikefarah/yq/

kislyuk commented 3 years ago

Thanks @dosmanak, that is correct.