From f18c5161e0c02fabfba3e3acbc4b52e95eb928c6 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Sat, 11 Jan 2020 16:01:32 +1100 Subject: [PATCH] Fixed sponge instructions --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 541bdcbc..63664bc4 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,16 @@ snap install yq `yq` installs with with [_strict confinement_](https://docs.snapcraft.io/snap-confinement/6233) in snap, this means it doesn't have direct access to root files. To read root files you can: ``` -sudo cat /etc/myfile | yq -r - somecommand +sudo cat /etc/myfile | yq r - a.path ``` And to write to a root file you can either use [sponge](https://linux.die.net/man/1/sponge): ``` -sudo cat /etc/myfile | yq -r - somecommand | sudo sponge /etc/myfile +sudo cat /etc/myfile | yq w - a.path value | sudo sponge /etc/myfile ``` or write to a temporary file: ``` -sudo cat /etc/myfile | yq -r - somecommand | sudo tee /etc/myfile.tmp +sudo cat /etc/myfile | yq w - a.path value | sudo tee /etc/myfile.tmp sudo mv /etc/myfile.tmp /etc/myfile rm /etc/myfile.tmp ```