https://github.com/mochitto/ised
Interactive sed, to have a better idea of what you are going to change with sed.
https://github.com/mochitto/ised
Last synced: 2 months ago
JSON representation
Interactive sed, to have a better idea of what you are going to change with sed.
- Host: GitHub
- URL: https://github.com/mochitto/ised
- Owner: Mochitto
- License: gpl-3.0
- Created: 2023-02-20T21:25:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-20T22:29:44.000Z (over 3 years ago)
- Last Synced: 2025-10-10T01:48:03.549Z (10 months ago)
- Language: Shell
- Size: 228 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
```
$$\ $$$$$$\ $$\
\__|$$ __$$\ $$ |
$$\ $$ / \__| $$$$$$\ $$$$$$$ |
$$ |\$$$$$$\ $$ __$$\ $$ __$$ |
$$ | \____$$\ $$$$$$$$ |$$ / $$ |
$$ |$$\ $$ |$$ ____|$$ | $$ |
$$ |\$$$$$$ |\$$$$$$$\ \$$$$$$$ |
\__| \______/ \_______| \_______|
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](https://github.com/jeffkaufman/icdiff).
## Demo


## Installation
- Install `icdiff` using `pip`.
```bash
pip install icdiff
```
- Clone this repository.
```bash
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`.
## Usage
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.
### Notice!
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).
```bash
iSed -r "s/foo/bar/g" my_file.txt
```
## Contributing
Pull requests are super welcome. 💕
For major changes, please open an issue first, to discuss what you would like to change.
## License
This project's license: [GPL3](https://choosealicense.com/licenses/gpl-3.0/).
You can also find the license of `icdiff` [here](https://github.com/jeffkaufman/icdiff/blob/master/LICENSE).