Skip to content

pure-bash, regex-enabled, multi-pattern terminal highlighter

License

Notifications You must be signed in to change notification settings

mustache1up/hi-terminal-highlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TL;DR:

Highlights each word/regex in a diferent color.

# import hi
source ./hi.sh

# call it over a pipe and pass one or more word/regex
cat examples/input.txt | hi over [0-9]+

What is hi

hi is a pure-bash, regex-enabled, multi-pattern highlighter ready to be use directly in the terminal, making it easier to spot relevant pieces of information.

Usage:

<some_command> | hi REGEX [ REGEX ... ]

REGEX    Bash style regular expression. 

Examples:

ping -c 4 127.0.0.1 | hi from

ping -c 4 127.0.0.1 | hi [0-9]+

ping -c 4 127.0.0.1 | hi from bytes [0-9]+
 
ping -c 4 127.0.0.1 | hi ttl "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"

Running unit tests

sudo apt-get install shunit2

bash ./unit_test.sh

About

pure-bash, regex-enabled, multi-pattern terminal highlighter

Topics

Resources

License

Stars

Watchers

Forks

Languages