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
- Host: GitHub
- URL: https://github.com/mitvix/replacestring
- Owner: mitvix
- Created: 2024-12-08T15:39:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T15:58:02.000Z (over 1 year ago)
- Last Synced: 2024-12-08T16:29:33.018Z (over 1 year ago)
- Language: Shell
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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