Giter Club home page Giter Club logo

ised's Introduction

$$\  $$$$$$\                  $$\ 
\__|$$  __$$\                 $$ |
$$\ $$ /  \__| $$$$$$\   $$$$$$$ |
$$ |\$$$$$$\  $$  __$$\ $$  __$$ |
$$ | \____$$\ $$$$$$$$ |$$ /  $$ |
$$ |$$\   $$ |$$   ____|$$ |  $$ |
$$ |\$$$$$$  |\$$$$$$$\ \$$$$$$$ |
\__| \______/  \_______| \_______|

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.

Demo

A demo of the script running in the terminal A demo of the script running in the terminal

Installation

  • Install icdiff using pip.
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.

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).

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.

You can also find the license of icdiff here.

ised's People

Contributors

mochitto avatar

Stargazers

 avatar Roman avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.