Advanced

Scripting a 4-Color Multiple Grepper

Posted by eldersnake on · Post a comment
The Linux Rain; By Bob Mesibov
Mail this story
Print this story

I wrote the shell script described here ('grep4') to find up to four items at the same time in my data tables, which are big text files with one record per line. The script gives each searched-for item its own color on the terminal screen. It lets me know in advance how many 'hits' there are, so that if there are lots of hits, I get the choice of printing the results to a file instead of displaying them. The script also lets me choose between seeing all records with any of the items (the OR case: A or B or...) or just the records containing all the searched-for items on one line (the AND case: A and B and...).

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments

No comments yet. Be the first.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post