Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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!

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
```