# Write the data structure back to your file in YAML If it just prints I have yaml then you have both python and pyaml installed and can use it in a trivial script ( update_script.py): import yamlĬontent = "new_name" Then on the command line run: python3 foo.py Make a file foo.py containing just: import yaml The very fact you are interacting with yaml files yourself makes this more likely. A lot of linux distributions ship with "python" and the rise of yaml means that the library "pyaml" it is also often installed. You haven't given us any idea of what system you are using or what's already installed. Tried with awk and sed but that did not work: lineNR=$(awk "/\ I am new to bash, dragged into a problem where I need to update some dynamic parameters in a yaml fileīased on query ( ), i need to update name: old_name
0 Comments
Leave a Reply. |