Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:misc [2026/03/04 16:51] – [jq] tmadelinux:misc [2026/06/12 11:07] (current) – [Set variable] tmade
Line 38: Line 38:
 ====yq==== ====yq====
 yq - commandline YAML processor, to visualize yaml output in a readable way yq - commandline YAML processor, to visualize yaml output in a readable way
 +
 +Example to replace a openshift-route with yq:
  
   oc get route/${route} -o yaml | yq eval '.spec.tls.certificate = strenv(TLSCERT) | .spec.tls.key = strenv(TLSKEY)' - | oc replace -f -   oc get route/${route} -o yaml | yq eval '.spec.tls.certificate = strenv(TLSCERT) | .spec.tls.key = strenv(TLSKEY)' - | oc replace -f -
Line 81: Line 83:
 Foo Foo
 </code> </code>
 +
 +====Set variable====
 +Alternative to "sed":
 +
 +  var="oldvalue"
 +  var="${var/oldvalue/newvalue}"
 +  echo $var
 +  newvalue
 +
  
 ====awk==== ====awk====
linux/misc.1772639496.txt.gz · Last modified: by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki