$$\ $$$$$$\ $$\
\__|$$ __$$\ $$ |
$$\ $$ / \__| $$$$$$\ $$$$$$$ |
$$ |\$$$$$$\ $$ __$$\ $$ __$$ |
$$ | \____$$\ $$$$$$$$ |$$ / $$ |
$$ |$$\ $$ |$$ ____|$$ | $$ |
$$ |\$$$$$$ |\$$$$$$$\ \$$$$$$$ |
\__| \______/ \_______| \_______|
v0.1.0
iSed (interactive sed) is a small script that allows you to see what your sed command will change, before making those changes.
The script wraps sed and icdiff.
- Install
icdiff
usingpip
.
pip install icdiff
- Clone this repository.
git clone https://github.com/Mochitto/iSed.git
- Turn the script into an executable.
- Move it to your bin directory to run it with
iSed
.
iSed has the same interface as sed
.
Once you define your command, you will be shown a git-style diff, where you can evaluate if to continue or not.
To do this, the script pipes the output of sed to a temporary file, that overwrites the original if the changes are deemed correct.
It will not prevent you from changing the file in place with sed
's -i
flag.
It's also important to put the file to change as last argument (I'm new to scripting, hopefully someone can help make this better).
iSed -r "s/foo/bar/g" my_file.txt
Pull requests are super welcome. ๐
For major changes, please open an issue first, to discuss what you would like to change.
This project's license: GPL3.
You can also find the license of icdiff
here.