Colourful grep on aix.
Linux implements a decent version of grep and highlights the search term using colour. Whilst AIX terminals can support colour (if your term session supports it) with escape codes I have not seen any way of making grep or egrep etc colourful.
On linux you simply add the parameter –color=auto such as
grep --color=auto SearchTerm {files}
Well as I couldn’t find anything on google I decided to implement something. And this is what I came up with. However the one bug I didn’t manage to resolve was If searching case insensitively the highlighting will only find the correct case. As sed does not support case insensitively this is a problem to solve. If nawk or gawk is installed, they do support it with the -i parameter.
#!/bin/ksh
#************************************************************************
# *
# Module Name : grepc.sh *
# Author : Dave Jarman +
# *
# Edit Record (most recent edit at top of list) *
# Date By CF Comments *
# --------- --- ---- --------------------------------------- *
# 5-Apr-12 DCJ i Use ampersand in sed search results as
# matched string to better handle regular
# expressions (thanks Zolo).
# 20-Sep-11 DCJ New file *
#************************************************************************
#
# Executes grep but with the escape codes to colourise the output.
#
# Known Bugs:
# If searching case insensitively the highlighting will only find the
# correct case. As sed does not support case insensitively this is a problem
# to solve. If nawk or gawk is installed, they do support it with the -i
# parameter.
#
# Other colours are available. Use the following lines.
# Blue echo "s/$QRY/\033[1;34m$QRY\033[0m/g" > $TMP/$$.sed
# Light blue echo "s/$QRY/\033[1;36m$QRY\033[0m/g" > $TMP/$$.sed
# Inverse blue echo "s/$QRY/\033[44;37m$QRY\033[0m/g" > $TMP/$$.sed
# Red echo "s/$QRY/\033[0;31m$QRY\033[0m/g" > $TMP/$$.sed
#************************************************************************
# Check for any options and save them
OPT=
while [[ $1 = [-+]?* ]]
do
OPT="$OPT $1"
shift
done
#
# Get the search string.
QRY=$1
shift
#
# Create a sed script to subsitiute for the appropriate colour.
# Show the search term in Blue
# echo "s/$QRY/\033[1;34m$QRY\033[0m/g" > $TMP/$$.sed
echo "s/$QRY/\033[1;34m&\033[0m/g" > $TMP/$$.sed
# echo /usr/bin/grep $OPT "$QRY" $* "|" sed -u -f $TMP/$$.sed
/usr/bin/grep $OPT "$QRY" $* | sed -f $TMP/$$.sed
#
# Clean up the tmp file *
rm $TMP/$$.sed
#
# Finish
exit 0
Businesses often equate image and reputation. But in fact, these concepts have completely different meanings reputation house reviews
First of all I want to say great blog! I had a quick
question in which I’d like to ask if you do not mind.
I was curious to know how you center yourself and clear your mind before writing.
I have had a difficult time clearing my mind in getting my ideas out there.
I truly do enjoy writing but it just seems like the first 10 to 15 minutes are wasted
simply just trying to figure out how to begin. Any recommendations
or tips? Many thanks!
http://www.auradoma.ru/bitrix/rk.php?goto=https%3A%2F%2Fmallmed.ru%2Fbitrix%2Frk.php%3Fgoto%3Dhttp%3A%2F%2F45.8.146.160%3Fgoto%3Dhttps%3A%2F%2F45.8.146.160%2F
Oh my goodness! Incredible article dude! Thank you
so much, However I am experiencing difficulties with your RSS.
I don’t know why I can’t join it. Is there anybody else having identical RSS issues?
Anyone that knows the solution will you kindly respond?
Thanx!!
Thanks a lot for sharing this with all folks you really realize what you are talking about!
Bookmarked. Please additionally discuss with my site =).
We could have a link trade contract among us
Компания Садко интернет магазин по продаже сантехники, оборудования и аксессуаров для ванной комнаты и кухни. Компания Садко предлагает широкий ассортимент продукции от ведущих производителей, таких как и многое другое.
Одним из преимуществ сайта является то, что пользователи могут получить квалифицированную консультацию от специалистов по выбору сантехники, а также помощь в оформлении заказа и доставки до подъезда. Компания Садко предлагает различные варианты оплаты и доставки в партнерстве с надежными транспортными компаниями.
Hey! This is kind of off topic but I need some help from
an established blog. Is it hard to set up your own blog?
I’m not very techincal but I can figure things out pretty quick.
I’m thinking about creating my own but I’m not sure where to start.
Do you have any points or suggestions? Many thanks
http://www.empyrethegame.com/forum/memberlist.php?mode=viewprofile&u=286927
Hi, Neat post. There is a problem along with your web site in internet explorer, could check this?
IE still is the market leader and a good component to other people
will pass over your magnificent writing due to this
problem.
In fact when someone doesn’t know afterward its up to other users that
they will assist, so here it happens.
https://bogin40.z11.web.core.windows.net/research/bogin40-(12).html
Browse by scoop necklines or take a glance at the strapless choices.
Businesses often equate image and reputation. But in fact, these concepts have completely different meanings reputation house serm
http://digimarketing21.s3-website.eu-central-1.amazonaws.com/research/digimarketing21-(52).html
Celebrate their huge day in style with our Mother of the Bride or Groom outfits.
Businesses often equate image and reputation. But in fact, these concepts have completely different meanings reputation house customers reviews
Very good blog! Do you have any helpful hints for aspiring writers?
I’m planning to start my own website soon but I’m a little lost on everything.
Would you propose starting with a free platform like WordPress or go for
a paid option? There are so many options out there that I’m totally overwhelmed ..
Any suggestions? Thanks!
I couldn’t resist commenting. Well written!
https://bogin43.blr1.digitaloceanspaces.com/research/bogin43-(38).html
For the redwood location, it will be nice to put on one thing in pure colors like the two moss green outfits pictured.
At this time it sounds like Expression Engine is the preferred blogging platform
available right now. (from what I’ve read) Is that what you’re using
on your blog? https://B-Sovety.ru/user/MavisAldridge51/
At this time it sounds like Expression Engine is the preferred blogging platform available right now.
(from what I’ve read) Is that what you’re using on your blog? https://B-Sovety.ru/user/MavisAldridge51/
My coder is trying to convince me to move to .net
from PHP. I have always disliked the idea because of the costs.
But he’s tryiong none the less. I’ve been using WordPress on numerous
websites for about a year and am nervous about switching to another platform.
I have heard excellent things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?
Any help would be really appreciated!
Fantastіc beat ! I wish tto apprenyіce while you amend your website,
how can i subscriЬe for a blⲟg sitе? Thee acount helped mе a acceptable deal.
I had been a ⅼittⅼе bit acquainted of this your brooadcast offered
bright clear concept
http://digimarketing28.s3-website.eu-central-2.amazonaws.com/research/digimarketing28-(528).html
This glamorous robe in heat and rich gold enhances all pores and skin tones and pairs superbly with gold and silver accessories.
https://digi9.research.au-syd1.upcloudobjects.com/research/digi9-(213).html
At as soon as effortless and refined, this superbly draped gown is the perfect hue for a fall wedding ceremony.
Good blog post. I definitely appreciate this site.
Keep writing!
유튜브 마케팅
https://bogin005.netlify.app/research/bogin005-(167)
Summer mom of the bride attire are usually full of shiny floral patterns that look great.
It’s an awesome post designed for all the internet viewers; they will obtain advantage from it I
am sure.
https://digi3.research.au-syd1.upcloudobjects.com/research/digi3-(510).html
There are ideas here on tips on how to put on pants for the mother of the bride.
buy viagra online
https://bogin44.syd1.digitaloceanspaces.com/research/bogin44-(479).html
Look for materials like breezy chiffon, breathable mesh, or draping georgette for the final word seashore wedding apparel.
If some one needs to be updated with hottest technologies afterward he must be pay
a visit this site and be up to date daily.
Generally I do not read article on blogs, but I wish to say that this write-up very pressured me to check out and do so!
Your writing style has been surprised me. Thanks, very nice post.
https://digi6.blr1.digitaloceanspaces.com/research/digi6-(302).html
The entire look was the right match for the couple’s tradition-filled day.
Unquestionably consider that which you said. Your favorite reason seemed to be at the
web the easiest factor to consider of. I say to you,
I definitely get annoyed while folks think about issues that they just don’t realize about.
You managed to hit the nail upon the top as smartly
as outlined out the entire thing with no need side-effects , other people could take a signal.
Will likely be again to get more. Thank you
https://bogin59.z20.web.core.windows.net/research/bogin59-(31).html
This surprisingly reasonably priced mother-of-the-bride gown is perfect for a formal fall or winter wedding.
When someone writes an post he/she maintains the thought of a user in his/her brain that how a user
can understand it. So that’s why this post is great.
Thanks!
What’s up colleagues, nice article and fastidious urging commented at this place, I am genuinely
enjoying by these.
When someone writes an paragraph he/she keeps the plan of a user in his/her brain that how
a user can know it. Therefore that’s why this piece of
writing is perfect. Thanks!
bookmarked!!, I like your web site!
Super-Duper blog! I am loving it!! Will be back later to read some more.
I am bookmarking your feeds also.
https://kofeinia.org/viewtopic.php?f=115&t=35906
Everyone loves it when folks get together and share thoughts.
Great blog, continue the good work!
I am extremely impressed with your writing skills
and also with the layout on your blog. Is this a paid theme or did you modify it yourself?
Either way keep up the nice quality writing, it is rare to see a nice blog like this one today.
When someone writes an article he/she keeps the idea of a user in his/her brain that how a user can be awsare off it.
Thus that’s why this piece of writing is great.
Thanks!
Take a look at my web blog :: forum anglia pll (friendly-kangaroo-hchb7p.mystrikingly.com)
https://bogin1.research.au-syd1.upcloudobjects.com/research/bogin1-(17).html
You can at all times add a wrap when you don’t wish to showcase your arms.
I am not sure where you are getting your info,
but good topic. I needs to spend some time finding out more or understanding more.
Thank you for wonderful info I was looking for this
info for my mission.
Howdy this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or
if you have to manually code with HTML. I’m starting a
blog soon but have no coding knowledge so I wanted to get guidance from someone
with experience. Any help would be greatly appreciated!
Aw, this was a very good post. Spending some time and actual effort to create a top notch article… but
what can I say… I hesitate a lot and never manage to get anything done.
I’m not that much of a internet reader to be honest but your blogs really nice, keep it up!
I’ll go ahead and bookmark your site to come back later.
Cheers
Hey! I know this is kinda off topic but I was wondering if you knew where
I could find a captcha plugin for my comment form? I’m
using the same blog platform as yours and I’m having
problems finding one? Thanks a lot!
Thanks for sharing such a good thinking, post is good,
thats why i have read it fully
https://bogin32.z10.web.core.windows.net/research/bogin32-(1).html
If full skirts and punchy prints aren’t your mom’s go-to, try a press release sleeve.