This is my text munging tool. There are many like it, but this one is mine.
linesieve is an unholy blend of grep, sed, awk, and Python, born out of spite.
linesieve allows you to:
split text input into sections
apply filters to specific sections
search and highlight success/failure markers
match/sub/split with the full power of Python’s re
shorten paths, links and module names
chain filters into pipelines
Install and update using pip:
$ pip install --upgrade linesieve
A simple example
$ ls -1 /* | linesieve -s '.*:' show bin match ^d head -n2 ..... /bin: dash date ...... /sbin: disklabel dmesg ...
This prints the first two files starting with
from each directory whose name contains
(skipped directories are marked with a dot on stderr).
PyPI Releases: https://pypi.org/project/linesieve/
Issue Tracker: https://github.com/lemon24/linesieve/issues
Source Code: https://github.com/lemon24/linesieve