yq

yq processing a string with quotation marks

冷暖自知 提交于 2021-01-27 06:49:43
问题 Currently I am trying to exchange a string but WITH double quotes in a YAML file with the mikefarah/yq processor (version 3.1.2 on an Ubuntu machine) similar to the following: config: app: name: "string" So I tried to solve this classically for me first with: yq w -i appconfig.yml config.app.name "exchangedstring" But the quotation marks were not included in the string. config: app: name: exchangedstring I have made several attempts to escape the string to get the desired result, but

yq processing a string with quotation marks

戏子无情 提交于 2021-01-27 06:49:33
问题 Currently I am trying to exchange a string but WITH double quotes in a YAML file with the mikefarah/yq processor (version 3.1.2 on an Ubuntu machine) similar to the following: config: app: name: "string" So I tried to solve this classically for me first with: yq w -i appconfig.yml config.app.name "exchangedstring" But the quotation marks were not included in the string. config: app: name: exchangedstring I have made several attempts to escape the string to get the desired result, but

Convery yaml array to string array

北战南征 提交于 2020-07-22 05:53:49
问题 I have a yq read command as below, groups=$(yq read generated/identity-mapping.yaml "iamIdentityMappings.[0].groups") It reads iamIdentityMappings from below yaml: iamIdentityMappings: - groups: - Appdeployer - Moregroups It stores group as below, - Appdeployer - Moregroups But I want to store groups as below.(comma separated values) groups="Appdeployer","Moregroups" How to do this in bash? 回答1: yq is just a wrapper for jq , which supports CSV output: $ groups="$(yq -r '.iamIdentifyMappings[0

Convery yaml array to string array

时光总嘲笑我的痴心妄想 提交于 2020-07-22 05:52:11
问题 I have a yq read command as below, groups=$(yq read generated/identity-mapping.yaml "iamIdentityMappings.[0].groups") It reads iamIdentityMappings from below yaml: iamIdentityMappings: - groups: - Appdeployer - Moregroups It stores group as below, - Appdeployer - Moregroups But I want to store groups as below.(comma separated values) groups="Appdeployer","Moregroups" How to do this in bash? 回答1: yq is just a wrapper for jq , which supports CSV output: $ groups="$(yq -r '.iamIdentifyMappings[0

Edit yaml objects in array with yq. Speed up Terminalizer's terminal cast (record)

此生再无相见时 提交于 2019-12-11 06:17:04
问题 The goal: Speed up Terminalizer's terminal cast (record) I have a record of terminal created with Terminalizer. cast.yaml : # The configurations that used for the recording, feel free to edit them config: # do not touch it # Records, feel free to edit them records: - delay: 841 content: "\e]1337;RemoteHost=kyb@kyb-nuc\a\e]1337;CurrentDir=/home/kyb/devel/git-rev-label\a\e]1337;ShellIntegrationVersion=7;shell=fish\a" - delay: 19 content: "\e]1337;RemoteHost=kyb@kyb-nuc\a\e]1337;CurrentDir=/home