Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iann0036/censor-shell
Censors or hides shell / Bash / console output based on defined patterns - great for hiding secrets in demos!
https://github.com/iann0036/censor-shell
asciinema bash shell
Last synced: about 1 month ago
JSON representation
Censors or hides shell / Bash / console output based on defined patterns - great for hiding secrets in demos!
- Host: GitHub
- URL: https://github.com/iann0036/censor-shell
- Owner: iann0036
- License: mit
- Created: 2021-04-22T11:41:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-22T15:38:04.000Z (over 3 years ago)
- Last Synced: 2024-06-20T14:18:06.135Z (3 months ago)
- Topics: asciinema, bash, shell
- Language: Go
- Homepage:
- Size: 1.04 MB
- Stars: 41
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# censor-shell
![](https://github.com/iann0036/iann0036/blob/master/static/censor-shell.gif?raw=true)
## Installation
```
go install
```## Usage
Make the file `~/.censor-shell` as an INI file with the following content:
```
[nameofmyreplacement]
pattern = badword
replacement = goodword[anotherpattern]
pattern = abc([a-z]+)ghi
replacement = zyx${1}tsr
```You can specify any amount of replacement rules as you like. Patterns and replacement follow standard Go [regexp](https://golang.org/pkg/regexp/) formats.
Now open a new shell and execute the `censor-shell` command. You'll be able to see that all outputs are replaced dynamically:
```
> echo badword
goodword
> echo abcdefghi
zyxdeftsr
```