Reputation: 31
I am looking to add an environment variable to a yaml file from the command line. I used yq. This is the command:
cat mytemplate.yml | yq -Y '.services.samson.environment += {"newKey":"newVal"}'
I keep getting this error:
Error: unknown shorthand flag: 'Y' in -Y
Usage:
yq [flags]
yq [command]
Any work-arounds for this
Upvotes: 2
Views: 4494
Reputation: 39738
You are probably confusing yq, the jq wrapper for YAML with yq, the jq reimplementation for YAML which are two different projects.
You have the second one installed but your usage of -Y
indicates you need the first one, since only that one has such an option. So you need to uninstall the currently installed yq
and then install the other one.
Upvotes: 5