Skip to content

Edit files in place #105

Open
Open
@ghost

Description

With GNU Sed for example you can edit files in place:

-i[SUFFIX], --in-place[=SUFFIX]

       edit files in place (makes backup if SUFFIX supplied)

However I see no option for this with JQ, currently I must do this:

br=$(mktemp)
jq .charlie delta.json > "$br"
mv "$br" delta.json

Here is a workaround, Awk slurp:

jq .firstName alfa.json | awk 'BEGIN{RS="";getline<"-";print>ARGV[1]}' alfa.json

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions