We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the inplace's license? I couldn't find any mention if this little program is open-source or not.
The text was updated successfully, but these errors were encountered:
this little program
its so simple i can write it in 10 lines of bash
#!/bin/sh # inplace.sh # Stream editor adaptor for in-place editing # based on https://github.com/nicowilliams/inplace # example use: # $ inplace somefile sed -e 's/foo/bar/g' # license: MIT. copyright (c) 2022 Milan Hauth set -e #set -x # debug [ "$#" = 0 ] && { echo "inplace: usage: inplace [-b .bak] file.txt sed 's/a/b/'" >&2; exit 1; } b=""; if [ "$1" = "-b" ]; then shift; b="$1"; shift; fi f="$1"; shift [ -n "$1" ] || { echo "inplace: missing argument: command" >&2; exit 1; } t=$(mktemp) # command is in $@ cat "$f" | "$@" >"$t" || { rc=$?; echo "inplace: command failed" >&2; exit $rc; } [ -n "$b" ] && printf "inplace: backup " >&2; cp -v "$f" "$f$b" >&2 mv "$t" "$f"
$ ./inplace.sh -b .bak foo.txt sed 's/a/b/' inplace: backup 'foo.txt' -> 'foo.txt.bak'
stuff like this should not even qualify for copyright, should be public domain by default
maybe ask moreutils to implement inplace (moreutils also has sponge)
inplace
sponge
Sorry, something went wrong.
No branches or pull requests
What is the inplace's license? I couldn't find any mention if this little program is open-source or not.
The text was updated successfully, but these errors were encountered: