An open API service indexing awesome lists of open source software.

https://github.com/mitvix/replacestring

Simple script in shell to replace strings from files using sed in a easy way
https://github.com/mitvix/replacestring

Last synced: over 1 year ago
JSON representation

Simple script in shell to replace strings from files using sed in a easy way

Awesome Lists containing this project

README

          

# Replace String
Simple script in shell to replace strings from files using sed in a easy way.

With this script it's possible replace content in files recursively, you just need pass the text that you are looking for and the text used to exchange.

## Configure
```
sudo chmod +x replacestring.sh
sudo cp replacestring.sh /usr/local/bin/
```
## Arguments

* $1 "original text"
* $2 "new text replace"
* $3 "filename"

## Usage:
```
replacestring.sh "original_text" "new_text_to_replace"
replacestring.sh "original_text" "new_text_to_replace" "*.php"
```

## Dependences

- grep https://www.gnu.org/software/grep/
- findutils https://www.gnu.org/software/findutils/
- xargs https://www.gnu.org/software/findutils/
- sed https://www.gnu.org/software/sed/

This is GNU Software, please share!

that's all