https://github.com/voutasaurus/sub
recursive text substitution tool
https://github.com/voutasaurus/sub
filesystem visitor-pattern
Last synced: 19 days ago
JSON representation
recursive text substitution tool
- Host: GitHub
- URL: https://github.com/voutasaurus/sub
- Owner: voutasaurus
- License: mit
- Created: 2017-02-20T09:55:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-20T10:06:44.000Z (over 9 years ago)
- Last Synced: 2023-07-31T17:37:15.270Z (almost 3 years ago)
- Topics: filesystem, visitor-pattern
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# s
A recursive find and replace tool.
# Install
Install go: https://golang.org/dl/
Then:
```
$ go get -u github.com/voutasaurus/s
```
# Usage:
```
$ s old new
```
This will (starting in the current directory) recursively replace the
string `old` by the string `new` in all files at or below this directory.
Files and directories beginning with `.` and `_` are ignored.
Files and directories named `vendor` are also ignored.
```
$ s -p old new
```
This will do the same except it prompts for each file before doing the replacement.
# why did you do this?
Because using `sed` to recursively replace one word with another word is genuinely harder to figure out how to do than writing a go program to do it.