Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting a error while using the yq -Y command

Tags:

yaml

yq

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

like image 782
sagar Avatar asked Dec 04 '25 13:12

sagar


1 Answers

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.

like image 179
flyx Avatar answered Dec 08 '25 20:12

flyx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!