Skip to content

write in the same file of input #46

@m47730

Description

@m47730

Hi,
i like your work to create a more modern envsubst combined with statically compiling with musl, it's a very portable and efficient solution.

I have a minor request: is it possible to implement write the output in the same file as input? (without using some other tool like sponge)

ex:

cat test.txt
test: it $TEST

export TEST=work
renvsubst --variable=TEST --input=test.txt --output=test.txt
file test.txt
  test.txt: empty

if the output file is different, it works perfectly:

renvsubst --variable=TEST --input=test.txt --output=test2.txt
cat test2.txt
test: it work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions