GREP_COLORS – change the colors in the GREP output.

2019-04-22 4 min read bash Linux
Today we will look at the variable GREP_COLORS. This variable determines the colour that is used with the grep command. You can look at the man page of the grep command to see what the various options mean. Here is the excerpt from the man command: GREP_COLORS Specifies the colors and other attributes used to highlight various parts of the output. Its value is a colon-separated list of capabilities that defaults to ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 with the rv and ne boolean capabilities omitted (i. Continue reading

create text tables from delimited files.

2013-07-12 1 min read bash Fedora
To create simple text tables to paste in emails or to use in any other document where you want to show a table, here is something that you can use. There is a perl module which provides “tablify“. And here is how to use it: sudo yum install perl-Text-RecordParser This will install a command “tablify” that you can use in number of ways. Here is a simple example to use it. Continue reading

Rekursive Grep on Solaris or AIX Systems without GNU egrep -r funcionality

2011-12-16 1 min read Learning Solaris
If you work regularly on a Solaris or systems which do not have the “-r” (recursive grep) for grep, then you know what a lifesaver this command can be. Here is one from command line fu: find . -type f -exec awk '/linux/ { printf "%s %s: %s\n", FILENAME, NR, $0; }' {} \; The benefit of using awk here is that you can print the line number also 🙂 Continue reading

bash regular expressions

2011-02-06 1 min read bash
Here are some quick links on bash regular expressions, pretty good links to bookmark, if you use, regular expressions in bash regularly. I especially like the tldp link at number 3. http://www.linuxjournal.com/content/bash-regular-expressions http://www.ibm.com/developerworks/library/l-bash.html http://tldp.org/LDP/abs/html/parameter-substitution.html#VARMATCH http://wellington.pm.org/archive/200005/codegen/index9.htm Related articles Renaming a whole bunch of files at once, in bash (ask.metafilter.com) bash math (amit-agarwal.co.in) Efficiency of regular expressions (johndcook.com) Autogenerate Regular Expressions with txt2re (readwriteweb.com)

Building a Finite State Machine Using DFA::Simple

2010-12-15 11 min read perl
http://www.perl.com/pub/2004/09/23/fsms.html Building a Finite State Machine Using DFA::Simple By Bill Ruppert on September 23, 2004 12:00 AM I am converting some articles from MS Word to HTML by hand. I often use bulleted outlines so I face a lot of work creating lists with nested sub-lists. It didn’t take opening and closing many and tags to realize I wanted to automate the task. It’s very easy to use filters with my text editor and I’ve written several in Perl to speed up my HTML formatting. Continue reading
Older posts